diff options
Diffstat (limited to 'ucb/source/ucp/odma/odma_lib.cxx')
-rwxr-xr-x[-rw-r--r--] | ucb/source/ucp/odma/odma_lib.cxx | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/ucb/source/ucp/odma/odma_lib.cxx b/ucb/source/ucp/odma/odma_lib.cxx index cf9da3a2b942..fde03a54c069 100644..100755 --- a/ucb/source/ucp/odma/odma_lib.cxx +++ b/ucb/source/ucp/odma/odma_lib.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -27,11 +28,10 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_ucb.hxx" -//#ifndef _OSL_PROCESS_H_ -//#include <osl/process.h> -//#endif #include <osl/module.h> #include <rtl/ustring.hxx> +#include <prewin.h> +#include <postwin.h> #include "odma_lib.hxx" @@ -70,13 +70,15 @@ namespace odma sal_Bool LoadFunctions(oslModule _pODMA); - sal_Bool LoadLibrary() + sal_Bool DMSsAvailable() { static sal_Bool bLoaded = sal_False; - static oslModule pODMA = NULL; + static sal_Bool bBeenHere = sal_False; + oslModule pODMA = NULL; + + if (bBeenHere) + return bLoaded; - if (bLoaded) - return sal_True; ::rtl::OUString sPath; #ifdef WNT sPath = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ODMA32.DLL")); @@ -85,11 +87,21 @@ namespace odma sPath = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("libodma.so")); #endif + bBeenHere = sal_True; + pODMA = osl_loadModule( sPath.pData,SAL_LOADMODULE_NOW ); if( !pODMA) return sal_False; - return bLoaded = LoadFunctions(pODMA); + if (!LoadFunctions(pODMA)) + return sal_False; + + bLoaded = (NODMGetDMSCount() > 0); + + if (getenv ("NO_ODMA")) + bLoaded = sal_False; + + return bLoaded; } // ------------------------------------------------------------------------- @@ -127,3 +139,5 @@ namespace odma return sal_True; } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |