diff options
author | blythe%netscape.com <devnull@localhost> | 2002-02-05 20:56:33 +0000 |
---|---|---|
committer | blythe%netscape.com <devnull@localhost> | 2002-02-05 20:56:33 +0000 |
commit | 4fce542a14d0f35141d3ae59b380124f3d1c64d5 (patch) | |
tree | 0280173ddbdee6a5b58a95da9b10724559088abf | |
parent | 55a123b1a31e8eac4590099a18cfd3dd7444c48d (diff) | |
download | nspr-hg-4fce542a14d0f35141d3ae59b380124f3d1c64d5.tar.gz |
Fix initial compile time error.
Use conversion in more multibyte to wide char places.
-rw-r--r-- | pr/src/linking/prlink.c | 38 | ||||
-rw-r--r-- | pr/src/md/windows/w32unicode.c | 4 |
2 files changed, 40 insertions, 2 deletions
diff --git a/pr/src/linking/prlink.c b/pr/src/linking/prlink.c index 050abca7..55776cde 100644 --- a/pr/src/linking/prlink.c +++ b/pr/src/linking/prlink.c @@ -615,7 +615,24 @@ pr_LoadLibraryByPathname(const char *name, PRIntn flags) HINSTANCE h; NODL_PROC *pfn; +#if !defined(WINCE) h = LoadLibrary(name); +#else + { + LPWSTR ceName = NULL; + + ceName = _PR_MD_MALLOC_A2W(name); + if(NULL != ceName) + { + h = LoadLibrary(ceName); + PR_Free(ceName); + } + else + { + h = NULL; + } + } +#endif if (h < (HINSTANCE)HINSTANCE_ERROR) { oserr = _MD_ERRNO(); PR_DELETE(lm); @@ -630,7 +647,11 @@ pr_LoadLibraryByPathname(const char *name, PRIntn flags) ** Try to load a table of "static functions" provided by the DLL */ +#if !defined(WINCE) pfn = (NODL_PROC *)GetProcAddress(h, "NODL_TABLE"); +#else + pfn = (NODL_PROC *)GetProcAddress(h, TEXT("NODL_TABLE")); +#endif if (pfn != NULL) { lm->staticTable = (*pfn)(); } @@ -1221,7 +1242,24 @@ pr_FindSymbolInLib(PRLibrary *lm, const char *name) #endif /* XP_OS2 */ #if defined(WIN32) || defined(WIN16) +#if !defined(WINCE) f = GetProcAddress(lm->dlh, name); +#else + { + LPWSTR ceName = NULL; + + ceName = _PR_MD_MALLOC_A2W(name); + if(NULL != ceName) + { + f = GetProcAddress(lm->dlh, ceName); + PR_Free(ceName); + } + else + { + f = NULL; + } + } +#endif #endif /* WIN32 || WIN16 */ #ifdef XP_MAC diff --git a/pr/src/md/windows/w32unicode.c b/pr/src/md/windows/w32unicode.c index 66ade756..421970ec 100644 --- a/pr/src/md/windows/w32unicode.c +++ b/pr/src/md/windows/w32unicode.c @@ -69,7 +69,7 @@ LPWSTR _PR_MD_MALLOC_A2W(LPCSTR inString) { int neededWChars = 0; - neededWChars = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, (inString), -1, NULL, 0); \ + neededWChars = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, (inString), -1, NULL, 0); if(0 < neededWChars) { LPWSTR wstr = NULL; @@ -79,7 +79,7 @@ LPWSTR _PR_MD_MALLOC_A2W(LPCSTR inString) { int convertRes = 0; - convertRes = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, (str), -1, wstr, neededWChars); + convertRes = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, (inString), -1, wstr, neededWChars); if(0 == convertRes) { PR_Free(wstr); |