From 2421e3d1a540110054f9e4a54bbe6ee41c6d774a Mon Sep 17 00:00:00 2001 From: Rene Engelhard Date: Wed, 14 Apr 2010 09:58:22 +0200 Subject: nspluginglobal: ifdef UNIX -> LINUX and add missing ifdefs --- extensions/source/nsplugin/source/so_env.cxx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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 #include +#ifdef LINUX #include +#endif #include // 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; -- cgit v1.2.3