diff options
author | Rene Engelhard <rene@openoffice.org> | 2010-04-14 09:58:22 +0200 |
---|---|---|
committer | Rene Engelhard <rene@openoffice.org> | 2010-04-14 09:58:22 +0200 |
commit | 2421e3d1a540110054f9e4a54bbe6ee41c6d774a (patch) | |
tree | 04d066fc8f14a96e3686a5bbe99b6baa537a2074 /extensions | |
parent | nspluginglobal: remove unsed variable for WaE builds... (diff) | |
download | core-2421e3d1a540110054f9e4a54bbe6ee41c6d774a.tar.gz core-2421e3d1a540110054f9e4a54bbe6ee41c6d774a.zip |
nspluginglobal: ifdef UNIX -> LINUX and add missing ifdefs
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/source/nsplugin/source/so_env.cxx | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/extensions/source/nsplugin/source/so_env.cxx b/extensions/source/nsplugin/source/so_env.cxx index 88deb7ee5b37..53bcdd69b6ad 100644 --- a/extensions/source/nsplugin/source/so_env.cxx +++ b/extensions/source/nsplugin/source/so_env.cxx @@ -31,7 +31,9 @@ #ifdef UNIX #include <sys/types.h> #include <strings.h> +#ifdef LINUX #include <dlfcn.h> +#endif #include <stdarg.h> // For vsnprintf() #define NSP_vsnprintf vsnprintf @@ -120,7 +122,7 @@ restoreUTF8(char *pPath) return 0; } -#ifdef UNIX +#ifdef LINUX extern int nspluginOOoModuleHook (void** aResult); int nspluginOOoModuleHook (void** aResult) { @@ -240,12 +242,15 @@ int findReadSversion(void** aResult, int /*bWnt*/, const char* /*tag*/, const ch char lnkFileName[NPP_PATH_MAX] = {0}; char* pTempZero = NULL; +#ifdef LINUX /* try to fetch a 'self' pointer */ if (!nspluginOOoModuleHook (aResult)) return 0; /* .. now in $HOME */ +#endif sprintf(lnkFileName, "%s/.mozilla/plugins/libnpsoplugin%s", getenv("HOME"), SAL_DLLEXTENSION); +#ifdef LINUX ssize_t len = readlink(lnkFileName, realFileName, NPP_PATH_MAX-1); if (-1 == len) { @@ -255,6 +260,10 @@ int findReadSversion(void** aResult, int /*bWnt*/, const char* /*tag*/, const ch realFileName[len] = '\0'; if (NULL == (pTempZero = strstr(realFileName, "/program/libnpsoplugin" SAL_DLLEXTENSION))) +#else + if ((0 > readlink(lnkFileName, realFileName, NPP_PATH_MAX)) || + (NULL == (pTempZero = strstr(realFileName, "/program/libnpsoplugin" SAL_DLLEXTENSION)))) +#endif { *realFileName = 0; return -1; |