diff options
Diffstat (limited to 'nsprpub/pr/src')
-rw-r--r-- | nsprpub/pr/src/Makefile.in | 4 | ||||
-rw-r--r-- | nsprpub/pr/src/linking/prlink.c | 351 | ||||
-rw-r--r-- | nsprpub/pr/src/md/unix/os_Linux_ia64.s | 2 | ||||
-rw-r--r-- | nsprpub/pr/src/md/unix/os_Linux_ppc.s | 2 | ||||
-rw-r--r-- | nsprpub/pr/src/md/unix/os_Linux_x86.s | 2 | ||||
-rw-r--r-- | nsprpub/pr/src/md/unix/os_Linux_x86_64.s | 2 | ||||
-rw-r--r-- | nsprpub/pr/src/md/unix/unix.c | 6 | ||||
-rw-r--r-- | nsprpub/pr/src/md/windows/ntio.c | 10 | ||||
-rw-r--r-- | nsprpub/pr/src/md/windows/ntmisc.c | 24 | ||||
-rw-r--r-- | nsprpub/pr/src/md/windows/w95sock.c | 3 | ||||
-rw-r--r-- | nsprpub/pr/src/misc/prdtoa.c | 11 | ||||
-rw-r--r-- | nsprpub/pr/src/misc/prnetdb.c | 4 | ||||
-rw-r--r-- | nsprpub/pr/src/misc/prsystem.c | 13 |
13 files changed, 62 insertions, 372 deletions
diff --git a/nsprpub/pr/src/Makefile.in b/nsprpub/pr/src/Makefile.in index 2258dae61..d7c633daf 100644 --- a/nsprpub/pr/src/Makefile.in +++ b/nsprpub/pr/src/Makefile.in @@ -159,10 +159,6 @@ ifeq ($(OS_TARGET),Android) OS_LIBS += -llog endif -ifeq ($(OS_TARGET),MacOSX) -OS_LIBS = -framework CoreServices -framework CoreFoundation -endif - EXTRA_LIBS += $(OS_LIBS) # diff --git a/nsprpub/pr/src/linking/prlink.c b/nsprpub/pr/src/linking/prlink.c index 4e73d9df1..011ff17e6 100644 --- a/nsprpub/pr/src/linking/prlink.c +++ b/nsprpub/pr/src/linking/prlink.c @@ -7,11 +7,6 @@ #include <string.h> -#if defined(XP_MACOSX) && defined(USE_MACH_DYLD) -#include <Carbon/Carbon.h> -#include <CoreFoundation/CoreFoundation.h> -#endif - #ifdef XP_UNIX #ifdef USE_DLFCN #include <dlfcn.h> @@ -36,8 +31,6 @@ #endif #elif defined(USE_HPSHL) #include <dl.h> -#elif defined(USE_MACH_DYLD) -#include <mach-o/dyld.h> #endif #endif /* XP_UNIX */ @@ -46,8 +39,7 @@ /* * On these platforms, symbols have a leading '_'. */ -#if (defined(DARWIN) && defined(USE_MACH_DYLD)) \ - || defined(XP_OS2) \ +#if defined(XP_OS2) \ || ((defined(OPENBSD) || defined(NETBSD)) && !defined(__ELF__)) #define NEED_LEADING_UNDERSCORE #endif @@ -70,19 +62,9 @@ struct PRLibrary { #endif #endif -#if defined(XP_MACOSX) && defined(USE_MACH_DYLD) - CFragConnectionID connection; - CFBundleRef bundle; - Ptr main; - CFMutableDictionaryRef wrappers; - const struct mach_header* image; -#endif - #ifdef XP_UNIX #if defined(USE_HPSHL) shl_t dlh; -#elif defined(USE_MACH_DYLD) - NSModule dlh; #else void* dlh; #endif @@ -170,7 +152,7 @@ void _PR_InitLinker(void) #elif defined(USE_HPSHL) h = NULL; /* don't abort with this NULL */ -#elif defined(USE_MACH_DYLD) || defined(NO_DLOPEN_NULL) +#elif defined(NO_DLOPEN_NULL) h = NULL; /* XXXX toshok */ /* XXXX vlad */ #else #error no dll strategy @@ -270,7 +252,7 @@ PR_GetLibraryPath(void) #endif #if defined(XP_UNIX) -#if defined(USE_DLFCN) || defined(USE_MACH_DYLD) +#if defined(USE_DLFCN) { char *p=NULL; int len; @@ -428,203 +410,6 @@ PR_LoadLibrary(const char *name) return PR_LoadLibraryWithFlags(libSpec, 0); } -#if defined(USE_MACH_DYLD) -static NSModule -pr_LoadMachDyldModule(const char *name) -{ - NSObjectFileImage ofi; - NSModule h = NULL; - if (NSCreateObjectFileImageFromFile(name, &ofi) - == NSObjectFileImageSuccess) { - h = NSLinkModule(ofi, name, NSLINKMODULE_OPTION_PRIVATE - | NSLINKMODULE_OPTION_RETURN_ON_ERROR); - if (h == NULL) { - NSLinkEditErrors linkEditError; - int errorNum; - const char *fileName; - const char *errorString; - NSLinkEditError(&linkEditError, &errorNum, &fileName, &errorString); - PR_LOG(_pr_linker_lm, PR_LOG_MIN, - ("LoadMachDyldModule error %d:%d for file %s:\n%s", - linkEditError, errorNum, fileName, errorString)); - } - if (NSDestroyObjectFileImage(ofi) == FALSE) { - if (h) { - (void)NSUnLinkModule(h, NSUNLINKMODULE_OPTION_NONE); - h = NULL; - } - } - } - return h; -} -#endif - -#if defined(XP_MACOSX) && defined(USE_MACH_DYLD) - -/* -** macLibraryLoadProc is a function definition for a Mac shared library -** loading method. The "name" param is the same full or partial pathname -** that was passed to pr_LoadLibraryByPathName. The function must fill -** in the fields of "lm" which apply to its library type. Returns -** PR_SUCCESS if successful. -*/ - -typedef PRStatus (*macLibraryLoadProc)(const char *name, PRLibrary *lm); - -#ifdef __ppc__ - -/* -** CFM and its TVectors only exist on PowerPC. Other OS X architectures -** only use Mach-O as a native binary format. -*/ - -static void* TV2FP(CFMutableDictionaryRef dict, const char* name, void *tvp) -{ - static uint32 glue[6] = { 0x3D800000, 0x618C0000, 0x800C0000, 0x804C0004, 0x7C0903A6, 0x4E800420 }; - uint32* newGlue = NULL; - - if (tvp != NULL) { - CFStringRef nameRef = CFStringCreateWithCString(NULL, name, kCFStringEncodingASCII); - if (nameRef) { - CFMutableDataRef glueData = (CFMutableDataRef) CFDictionaryGetValue(dict, nameRef); - if (glueData == NULL) { - glueData = CFDataCreateMutable(NULL, sizeof(glue)); - if (glueData != NULL) { - newGlue = (uint32*) CFDataGetMutableBytePtr(glueData); - memcpy(newGlue, glue, sizeof(glue)); - newGlue[0] |= ((UInt32)tvp >> 16); - newGlue[1] |= ((UInt32)tvp & 0xFFFF); - MakeDataExecutable(newGlue, sizeof(glue)); - CFDictionaryAddValue(dict, nameRef, glueData); - CFRelease(glueData); - - PR_LOG(_pr_linker_lm, PR_LOG_MIN, ("TV2FP: created wrapper for CFM function %s().", name)); - } - } else { - PR_LOG(_pr_linker_lm, PR_LOG_MIN, ("TV2FP: found wrapper for CFM function %s().", name)); - - newGlue = (uint32*) CFDataGetMutableBytePtr(glueData); - } - CFRelease(nameRef); - } - } - - return newGlue; -} - -static PRStatus -pr_LoadViaCFM(const char *name, PRLibrary *lm) -{ - OSErr err; - Str255 errName; - FSRef ref; - FSSpec fileSpec; - Boolean tempUnusedBool; - - /* - * Make an FSSpec from the path name and call GetDiskFragment. - */ - - /* Use direct conversion of POSIX path to FSRef to FSSpec. */ - err = FSPathMakeRef((const UInt8*)name, &ref, NULL); - if (err != noErr) { - return PR_FAILURE; - } - err = FSGetCatalogInfo(&ref, kFSCatInfoNone, NULL, NULL, - &fileSpec, NULL); - if (err != noErr) { - return PR_FAILURE; - } - - /* Resolve an alias if this was one */ - err = ResolveAliasFile(&fileSpec, true, &tempUnusedBool, - &tempUnusedBool); - if (err != noErr) { - return PR_FAILURE; - } - - /* Finally, try to load the library */ - err = GetDiskFragment(&fileSpec, 0, kCFragGoesToEOF, fileSpec.name, - kLoadCFrag, &lm->connection, &lm->main, errName); - - if (err == noErr && lm->connection) { - /* - * if we're a mach-o binary, need to wrap all CFM function - * pointers. need a hash-table of already seen function - * pointers, etc. - */ - lm->wrappers = CFDictionaryCreateMutable(NULL, 16, - &kCFTypeDictionaryKeyCallBacks, - &kCFTypeDictionaryValueCallBacks); - if (lm->wrappers) { - lm->main = TV2FP(lm->wrappers, "main", lm->main); - } else { - err = memFullErr; - } - } - return (err == noErr) ? PR_SUCCESS : PR_FAILURE; -} -#endif /* __ppc__ */ - -/* -** Creates a CFBundleRef if the pathname refers to a Mac OS X bundle -** directory. The caller is responsible for calling CFRelease() to -** deallocate. -*/ - -static PRStatus -pr_LoadCFBundle(const char *name, PRLibrary *lm) -{ - CFURLRef bundleURL; - CFBundleRef bundle = NULL; - char pathBuf[PATH_MAX]; - const char *resolvedPath; - CFStringRef pathRef; - - /* Takes care of relative paths and symlinks */ - resolvedPath = realpath(name, pathBuf); - if (!resolvedPath) { - return PR_FAILURE; - } - - pathRef = CFStringCreateWithCString(NULL, pathBuf, kCFStringEncodingUTF8); - if (pathRef) { - bundleURL = CFURLCreateWithFileSystemPath(NULL, pathRef, - kCFURLPOSIXPathStyle, true); - if (bundleURL) { - bundle = CFBundleCreate(NULL, bundleURL); - CFRelease(bundleURL); - } - CFRelease(pathRef); - } - - lm->bundle = bundle; - return (bundle != NULL) ? PR_SUCCESS : PR_FAILURE; -} - -static PRStatus -pr_LoadViaDyld(const char *name, PRLibrary *lm) -{ - lm->dlh = pr_LoadMachDyldModule(name); - if (lm->dlh == NULL) { - lm->image = NSAddImage(name, NSADDIMAGE_OPTION_RETURN_ON_ERROR - | NSADDIMAGE_OPTION_WITH_SEARCHING); - if (lm->image == NULL) { - NSLinkEditErrors linkEditError; - int errorNum; - const char *fileName; - const char *errorString; - NSLinkEditError(&linkEditError, &errorNum, &fileName, &errorString); - PR_LOG(_pr_linker_lm, PR_LOG_MIN, - ("LoadMachDyldModule error %d:%d for file %s:\n%s", - linkEditError, errorNum, fileName, errorString)); - } - } - return (lm->dlh != NULL || lm->image != NULL) ? PR_SUCCESS : PR_FAILURE; -} - -#endif /* XP_MACOSX && USE_MACH_DYLD */ - /* ** Dynamically load a library. Only load libraries once, so scan the load ** map first. @@ -733,36 +518,7 @@ pr_LoadLibraryByPathname(const char *name, PRIntn flags) } #endif /* WIN32 */ -#if defined(XP_MACOSX) && defined(USE_MACH_DYLD) - { - int i; - PRStatus status; - - static const macLibraryLoadProc loadProcs[] = { -#ifdef __ppc__ - pr_LoadViaDyld, pr_LoadCFBundle, pr_LoadViaCFM -#else /* __ppc__ */ - pr_LoadViaDyld, pr_LoadCFBundle -#endif /* __ppc__ */ - }; - - for (i = 0; i < sizeof(loadProcs) / sizeof(loadProcs[0]); i++) { - if ((status = loadProcs[i](name, lm)) == PR_SUCCESS) { - break; - } - } - if (status != PR_SUCCESS) { - oserr = cfragNoLibraryErr; - PR_DELETE(lm); - goto unlock; - } - lm->name = strdup(name); - lm->next = pr_loadmap; - pr_loadmap = lm; - } -#endif - -#if defined(XP_UNIX) && !(defined(XP_MACOSX) && defined(USE_MACH_DYLD)) +#if defined(XP_UNIX) #ifdef HAVE_DLL { #if defined(USE_DLFCN) @@ -807,7 +563,7 @@ pr_LoadLibraryByPathname(const char *name, PRIntn flags) const size_t systemPrefixLen1 = strlen(systemPrefix1); const char systemPrefix2[] = "/usr/lib/"; const size_t systemPrefixLen2 = strlen(systemPrefix2); - const name_len = strlen(name); + const size_t name_len = strlen(name); if (((name_len > systemPrefixLen1) && (strncmp(name, systemPrefix1, systemPrefixLen1) == 0)) || ((name_len > systemPrefixLen2) && @@ -847,8 +603,6 @@ pr_LoadLibraryByPathname(const char *name, PRIntn flags) } /* No equivalent of PR_LD_GLOBAL and PR_LD_LOCAL. */ h = shl_load(name, shl_flags, 0L); -#elif defined(USE_MACH_DYLD) - NSModule h = pr_LoadMachDyldModule(name); #else #error Configuration error #endif @@ -863,7 +617,7 @@ pr_LoadLibraryByPathname(const char *name, PRIntn flags) pr_loadmap = lm; } #endif /* HAVE_DLL */ -#endif /* XP_UNIX && !(XP_MACOSX && USE_MACH_DYLD) */ +#endif /* XP_UNIX */ lm->refCount = 1; @@ -922,10 +676,6 @@ PR_UnloadLibrary(PRLibrary *lib) result = dlclose(lib->dlh); #elif defined(USE_HPSHL) result = shl_unload(lib->dlh); -#elif defined(USE_MACH_DYLD) - if (lib->dlh) { - result = NSUnLinkModule(lib->dlh, NSUNLINKMODULE_OPTION_NONE) ? 0 : -1; - } #else #error Configuration error #endif @@ -938,20 +688,6 @@ PR_UnloadLibrary(PRLibrary *lib) } #endif /* XP_PC */ -#if defined(XP_MACOSX) && defined(USE_MACH_DYLD) - /* Close the connection */ - if (lib->connection) { - CloseConnection(&(lib->connection)); - } - if (lib->bundle) { - CFRelease(lib->bundle); - } - if (lib->wrappers) { - CFRelease(lib->wrappers); - } - /* No way to unload an image (lib->image) */ -#endif - /* unlink from library search list */ if (pr_loadmap == lib) { pr_loadmap = pr_loadmap->next; @@ -1041,53 +777,6 @@ pr_FindSymbolInLib(PRLibrary *lm, const char *name) f = GetProcAddress(lm->dlh, name); #endif /* WIN32 */ -#if defined(XP_MACOSX) && defined(USE_MACH_DYLD) - /* add this offset to skip the leading underscore in name */ -#define SYM_OFFSET 1 - if (lm->bundle) { - CFStringRef nameRef = CFStringCreateWithCString(NULL, name + SYM_OFFSET, kCFStringEncodingASCII); - if (nameRef) { - f = CFBundleGetFunctionPointerForName(lm->bundle, nameRef); - CFRelease(nameRef); - } - } - if (lm->connection) { - Ptr symAddr; - CFragSymbolClass symClass; - Str255 pName; - - PR_LOG(_pr_linker_lm, PR_LOG_MIN, ("Looking up symbol: %s", name + SYM_OFFSET)); - - c2pstrcpy(pName, name + SYM_OFFSET); - - f = (FindSymbol(lm->connection, pName, &symAddr, &symClass) == noErr) ? symAddr : NULL; - -#ifdef __ppc__ - /* callers expect mach-o function pointers, so must wrap tvectors with glue. */ - if (f && symClass == kTVectorCFragSymbol) { - f = TV2FP(lm->wrappers, name + SYM_OFFSET, f); - } -#endif /* __ppc__ */ - - if (f == NULL && strcmp(name + SYM_OFFSET, "main") == 0) { - f = lm->main; - } - } - if (lm->image) { - NSSymbol symbol; - symbol = NSLookupSymbolInImage(lm->image, name, - NSLOOKUPSYMBOLINIMAGE_OPTION_BIND - | NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR); - if (symbol != NULL) { - f = NSAddressOfSymbol(symbol); - } - else { - f = NULL; - } - } -#undef SYM_OFFSET -#endif /* XP_MACOSX && USE_MACH_DYLD */ - #ifdef XP_UNIX #ifdef HAVE_DLL #ifdef USE_DLFCN @@ -1096,17 +785,6 @@ pr_FindSymbolInLib(PRLibrary *lm, const char *name) if (shl_findsym(&lm->dlh, name, TYPE_PROCEDURE, &f) == -1) { f = NULL; } -#elif defined(USE_MACH_DYLD) - if (lm->dlh) { - NSSymbol symbol; - symbol = NSLookupSymbolInModule(lm->dlh, name); - if (symbol != NULL) { - f = NSAddressOfSymbol(symbol); - } - else { - f = NULL; - } - } #endif #endif /* HAVE_DLL */ #endif /* XP_UNIX */ @@ -1289,23 +967,6 @@ PR_GetLibraryFilePathname(const char *name, PRFuncPtr addr) strcpy(result, dli.dli_fname); } return result; -#elif defined(USE_MACH_DYLD) - char *result; - const char *image_name; - int i, count = _dyld_image_count(); - - for (i = 0; i < count; i++) { - image_name = _dyld_get_image_name(i); - if (strstr(image_name, name) != NULL) { - result = PR_Malloc(strlen(image_name)+1); - if (result != NULL) { - strcpy(result, image_name); - } - return result; - } - } - PR_SetError(PR_LIBRARY_NOT_LOADED_ERROR, 0); - return NULL; #elif defined(AIX) char *result; #define LD_INFO_INCREMENT 64 diff --git a/nsprpub/pr/src/md/unix/os_Linux_ia64.s b/nsprpub/pr/src/md/unix/os_Linux_ia64.s index fef24ad10..39b724ae4 100644 --- a/nsprpub/pr/src/md/unix/os_Linux_ia64.s +++ b/nsprpub/pr/src/md/unix/os_Linux_ia64.s @@ -68,4 +68,4 @@ _PR_ia64_AtomicSet: .endp _PR_ia64_AtomicSet# // Magic indicating no need for an executable stack -.section .note.GNU-stack, "", @progbits ; .previous +.section .note.GNU-stack, "", @progbits diff --git a/nsprpub/pr/src/md/unix/os_Linux_ppc.s b/nsprpub/pr/src/md/unix/os_Linux_ppc.s index a9a83174a..76da33bff 100644 --- a/nsprpub/pr/src/md/unix/os_Linux_ppc.s +++ b/nsprpub/pr/src/md/unix/os_Linux_ppc.s @@ -72,4 +72,4 @@ _PR_ppc_AtomicAdd: .Lfe4: .size _PR_ppc_AtomicAdd,.Lfe4-_PR_ppc_AtomicAdd # Magic indicating no need for an executable stack -.section .note.GNU-stack, "", @progbits ; .previous +.section .note.GNU-stack, "", @progbits diff --git a/nsprpub/pr/src/md/unix/os_Linux_x86.s b/nsprpub/pr/src/md/unix/os_Linux_x86.s index a72acf5d7..83e10b455 100644 --- a/nsprpub/pr/src/md/unix/os_Linux_x86.s +++ b/nsprpub/pr/src/md/unix/os_Linux_x86.s @@ -82,4 +82,4 @@ _PR_x86_AtomicAdd: ret // Magic indicating no need for an executable stack -.section .note.GNU-stack, "", @progbits ; .previous +.section .note.GNU-stack, "", @progbits diff --git a/nsprpub/pr/src/md/unix/os_Linux_x86_64.s b/nsprpub/pr/src/md/unix/os_Linux_x86_64.s index 8e491f0e6..f30e75d53 100644 --- a/nsprpub/pr/src/md/unix/os_Linux_x86_64.s +++ b/nsprpub/pr/src/md/unix/os_Linux_x86_64.s @@ -71,4 +71,4 @@ _PR_x86_64_AtomicAdd: .size _PR_x86_64_AtomicAdd, .-_PR_x86_64_AtomicAdd // Magic indicating no need for an executable stack -.section .note.GNU-stack, "", @progbits ; .previous +.section .note.GNU-stack, "", @progbits diff --git a/nsprpub/pr/src/md/unix/unix.c b/nsprpub/pr/src/md/unix/unix.c index a8862a4ce..56b58aa72 100644 --- a/nsprpub/pr/src/md/unix/unix.c +++ b/nsprpub/pr/src/md/unix/unix.c @@ -3481,7 +3481,8 @@ PRStatus _MD_getsysinfo(PRSysInfo cmd, char *name, PRUint32 namelen) { struct utsname info; - PR_ASSERT((cmd == PR_SI_SYSNAME) || (cmd == PR_SI_RELEASE)); + PR_ASSERT((cmd == PR_SI_SYSNAME) || (cmd == PR_SI_RELEASE) || + (cmd == PR_SI_RELEASE_BUILD)); if (uname(&info) == -1) { _PR_MD_MAP_DEFAULT_ERROR(errno); @@ -3493,6 +3494,9 @@ PRStatus _MD_getsysinfo(PRSysInfo cmd, char *name, PRUint32 namelen) else if (PR_SI_RELEASE == cmd) { (void)PR_snprintf(name, namelen, info.release); } + else if (PR_SI_RELEASE_BUILD == cmd) { + (void)PR_snprintf(name, namelen, info.version); + } else { return PR_FAILURE; } diff --git a/nsprpub/pr/src/md/windows/ntio.c b/nsprpub/pr/src/md/windows/ntio.c index 040bbd310..40f520078 100644 --- a/nsprpub/pr/src/md/windows/ntio.c +++ b/nsprpub/pr/src/md/windows/ntio.c @@ -2252,6 +2252,7 @@ _PR_MD_READ(PRFileDesc *fd, void *buf, PRInt32 len) int rv, err; LONG hiOffset = 0; LONG loOffset; + LARGE_INTEGER offset; /* use for a normalized add of len to offset */ if (!fd->secret->md.sync_file_io) { PRThread *me = _PR_MD_CURRENT_THREAD(); @@ -2368,7 +2369,14 @@ _PR_MD_READ(PRFileDesc *fd, void *buf, PRInt32 len) return -1; } - SetFilePointer((HANDLE)f, me->md.blocked_io_bytes, 0, FILE_CURRENT); + /* Apply the workaround from bug 70765 (see _PR_MD_WRITE) + * to the reading code, too. */ + + offset.LowPart = me->md.overlapped.overlapped.Offset; + offset.HighPart = me->md.overlapped.overlapped.OffsetHigh; + offset.QuadPart += me->md.blocked_io_bytes; + + SetFilePointer((HANDLE)f, offset.LowPart, &offset.HighPart, FILE_BEGIN); PR_ASSERT(me->io_pending == PR_FALSE); diff --git a/nsprpub/pr/src/md/windows/ntmisc.c b/nsprpub/pr/src/md/windows/ntmisc.c index 1ec6c2a5e..839e3de8d 100644 --- a/nsprpub/pr/src/md/windows/ntmisc.c +++ b/nsprpub/pr/src/md/windows/ntmisc.c @@ -812,7 +812,8 @@ PRStatus _MD_WindowsGetSysInfo(PRSysInfo cmd, char *name, PRUint32 namelen) { OSVERSIONINFO osvi; - PR_ASSERT((cmd == PR_SI_SYSNAME) || (cmd == PR_SI_RELEASE)); + PR_ASSERT((cmd == PR_SI_SYSNAME) || (cmd == PR_SI_RELEASE) || + (cmd == PR_SI_RELEASE_BUILD)); ZeroMemory(&osvi, sizeof(OSVERSIONINFO)); osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); @@ -827,9 +828,13 @@ PRStatus _MD_WindowsGetSysInfo(PRSysInfo cmd, char *name, PRUint32 namelen) if (PR_SI_SYSNAME == cmd) { (void)PR_snprintf(name, namelen, "Windows_NT"); } - else if (PR_SI_RELEASE == cmd) + else if (PR_SI_RELEASE == cmd) { (void)PR_snprintf(name, namelen, "%d.%d",osvi.dwMajorVersion, osvi.dwMinorVersion); + } + else if (PR_SI_RELEASE_BUILD == cmd) { + (void)PR_snprintf(name, namelen, "%d", osvi.dwBuildNumber); + } break; case VER_PLATFORM_WIN32_WINDOWS: if (PR_SI_SYSNAME == cmd) { @@ -843,6 +848,8 @@ PRStatus _MD_WindowsGetSysInfo(PRSysInfo cmd, char *name, PRUint32 namelen) } else if (PR_SI_RELEASE == cmd) { (void)PR_snprintf(name, namelen, "%d.%d",osvi.dwMajorVersion, osvi.dwMinorVersion); + } else if (PR_SI_RELEASE_BUILD == cmd) { + (void)PR_snprintf(name, namelen, "%d", osvi.dwBuildNumber); } break; #ifdef VER_PLATFORM_WIN32_CE @@ -850,9 +857,15 @@ PRStatus _MD_WindowsGetSysInfo(PRSysInfo cmd, char *name, PRUint32 namelen) if (PR_SI_SYSNAME == cmd) { (void)PR_snprintf(name, namelen, "Windows_CE"); } - else if (PR_SI_RELEASE == cmd) + else if (PR_SI_RELEASE == cmd) { (void)PR_snprintf(name, namelen, "%d.%d",osvi.dwMajorVersion, osvi.dwMinorVersion); + } + else if (PR_SI_RELEASE_BUILD == cmd) { + if (namelen) { + *name = 0; + } + } break; #endif default: @@ -862,6 +875,11 @@ PRStatus _MD_WindowsGetSysInfo(PRSysInfo cmd, char *name, PRUint32 namelen) else if (PR_SI_RELEASE == cmd) { (void)PR_snprintf(name, namelen, "%d.%d",0,0); } + else if (PR_SI_RELEASE_BUILD == cmd) { + if (namelen) { + *name = 0; + } + } break; } return PR_SUCCESS; diff --git a/nsprpub/pr/src/md/windows/w95sock.c b/nsprpub/pr/src/md/windows/w95sock.c index 7d7362c60..5aff369be 100644 --- a/nsprpub/pr/src/md/windows/w95sock.c +++ b/nsprpub/pr/src/md/windows/w95sock.c @@ -7,6 +7,9 @@ * */ +#if defined(_WIN64) +#include <winsock2.h> +#endif #include "primpl.h" #define READ_FD 1 diff --git a/nsprpub/pr/src/misc/prdtoa.c b/nsprpub/pr/src/misc/prdtoa.c index f0963370f..51b331bac 100644 --- a/nsprpub/pr/src/misc/prdtoa.c +++ b/nsprpub/pr/src/misc/prdtoa.c @@ -304,17 +304,6 @@ static double private_mem[PRIVATE_mem], *pmem_next = private_mem; #else /* ifndef Bad_float_h */ #include "float.h" -/* - * MacOS 10.2 defines the macro FLT_ROUNDS to an internal function - * which does not exist on 10.1. We can safely #define it to 1 here - * to allow 10.2 builds to run on 10.1, since we can't use fesetround() - * (which does not exist on 10.1 either). - */ -#if defined(XP_MACOSX) && (!defined(MAC_OS_X_VERSION_10_2) || \ - MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_2) -#undef FLT_ROUNDS -#define FLT_ROUNDS 1 -#endif /* DT < 10.2 */ #endif /* Bad_float_h */ #ifndef __MATH_H__ diff --git a/nsprpub/pr/src/misc/prnetdb.c b/nsprpub/pr/src/misc/prnetdb.c index 6ad0242d6..0f645b647 100644 --- a/nsprpub/pr/src/misc/prnetdb.c +++ b/nsprpub/pr/src/misc/prnetdb.c @@ -166,9 +166,7 @@ static PRBool _pr_have_inet6_if = PR_FALSE; #undef DEBUG_QUERY_IFS #if defined(AIX) \ - || (defined(DARWIN) && (!defined(HAVE_GETIFADDRS) \ - || (defined(XP_MACOSX) && (!defined(MAC_OS_X_VERSION_10_2) || \ - MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_2)))) + || (defined(DARWIN) && !defined(HAVE_GETIFADDRS)) /* * Use SIOCGIFCONF ioctl on platforms that don't have routing diff --git a/nsprpub/pr/src/misc/prsystem.c b/nsprpub/pr/src/misc/prsystem.c index 825d3be0f..109f1ed23 100644 --- a/nsprpub/pr/src/misc/prsystem.c +++ b/nsprpub/pr/src/misc/prsystem.c @@ -152,6 +152,19 @@ PR_IMPLEMENT(PRStatus) PR_GetSystemInfo(PRSysInfo cmd, char *buf, PRUint32 bufle #endif /* OS2 */ break; + case PR_SI_RELEASE_BUILD: + /* Return the version of the operating system */ +#if defined(XP_UNIX) || defined(WIN32) + if (PR_FAILURE == _PR_MD_GETSYSINFO(cmd, buf, (PRUintn)buflen)) { + return PR_FAILURE; + } +#else + if (buflen) { + *buf = 0; + } +#endif /* XP_UNIX || WIN32 */ + break; + case PR_SI_ARCHITECTURE: /* Return the architecture of the machine (ie. x86, mips, alpha, ...)*/ (void)PR_snprintf(buf, buflen, _PR_SI_ARCHITECTURE); |