Bug 456449: updated NSPR to NSPR_HEAD_20090204.
authorWan-Teh Chang <wtc@google.com>
Wed, 04 Feb 2009 20:49:21 -0800
changeset 24649 389ac643c390b17752e34b5b4db58c0e1d6941cd
parent 24648 7f923bdce3d50a3e767c06a30b2ab4915b8521eb
child 24650 424fd31971f1e80b69f40e4f1e133bafb9a96ce8
push id5143
push userwtc@google.com
push dateThu, 05 Feb 2009 04:50:37 +0000
treeherdermozilla-central@424fd31971f1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs456449
milestone1.9.2a1pre
Bug 456449: updated NSPR to NSPR_HEAD_20090204.
nsprpub/admin/repackage.sh
nsprpub/configure
nsprpub/configure.in
nsprpub/pr/include/md/_netbsd.cfg
nsprpub/pr/include/md/_netbsd.h
nsprpub/pr/include/prinit.h
nsprpub/pr/src/Makefile.in
nsprpub/pr/src/io/prfile.c
nsprpub/pr/src/io/prio.c
nsprpub/pr/src/io/prlog.c
nsprpub/pr/src/linking/prlink.c
nsprpub/pr/src/md/windows/Makefile.in
nsprpub/pr/src/md/windows/ntsec.c
nsprpub/pr/src/md/windows/objs.mk
nsprpub/pr/src/md/windows/w32ipcsem.c
nsprpub/pr/src/md/windows/w32shm.c
nsprpub/pr/src/md/windows/w95sock.c
nsprpub/pr/src/md/windows/w95thred.c
nsprpub/pr/src/misc/prsystem.c
nsprpub/pr/tests/vercheck.c
--- a/nsprpub/admin/repackage.sh
+++ b/nsprpub/admin/repackage.sh
@@ -59,20 +59,20 @@
 # Note! Files written with Gnu tar are not readable by some non-Gnu
 # versions. Sun, in particular.
 # 
 # 
 # 
 # 
 # ------------------------------------------------------------------
 
-FROMTOP=/share/builds/components/nspr20/v4.7.4
-TOTOP=./v4.7.4
-NSPRDIR=nspr-4.7.4
-SOURCETAG=NSPR_4_7_4_RTM
+FROMTOP=/share/builds/components/nspr20/v4.8
+TOTOP=./v4.8
+NSPRDIR=nspr-4.8
+SOURCETAG=NSPR_4_8_RTM
 
 #
 # enumerate Unix object directories on /s/b/c
 UNIX_OBJDIRS="
 HP-UXB.11.11_64_DBG.OBJ
 HP-UXB.11.11_64_OPT.OBJ
 HP-UXB.11.11_DBG.OBJ
 HP-UXB.11.11_OPT.OBJ
--- a/nsprpub/configure
+++ b/nsprpub/configure
@@ -683,18 +683,18 @@ echo "$ac_t""$build" 1>&6
 
 test "$host_alias" != "$target_alias" &&
   test "$program_prefix$program_suffix$program_transform_name" = \
     NONENONEs,x,x, &&
   program_prefix=${target_alias}-
 
 
 MOD_MAJOR_VERSION=4
-MOD_MINOR_VERSION=7
-MOD_PATCH_VERSION=4
+MOD_MINOR_VERSION=8
+MOD_PATCH_VERSION=0
 NSPR_MODNAME=nspr20
 _HAVE_PTHREADS=
 USE_PTHREADS=
 USE_USER_PTHREADS=
 USE_NSPR_THREADS=
 USE_N32=
 USE_64=
 USE_CPLUS=
@@ -6065,17 +6065,17 @@ trap 'rm -f $CONFIG_STATUS conftest*; ex
 # Protect against Makefile macro expansion.
 cat > conftest.defs <<\EOF
 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
 s%[ 	`~#$^&*(){}\\|;'"<>?]%\\&%g
 s%\[%\\&%g
 s%\]%\\&%g
 s%\$%$$%g
 EOF
-DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
+DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' ' | tr '\015' ' '`
 rm -f conftest.defs
 
 
 # Without the "./", some shells look in PATH for config.status.
 : ${CONFIG_STATUS=./config.status}
 
 echo creating $CONFIG_STATUS
 rm -f $CONFIG_STATUS
--- a/nsprpub/configure.in
+++ b/nsprpub/configure.in
@@ -44,18 +44,18 @@ AC_INIT(config/libc_r.h)
 
 AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf)
 AC_CANONICAL_SYSTEM
 
 dnl ========================================================
 dnl = Defaults
 dnl ========================================================
 MOD_MAJOR_VERSION=4
-MOD_MINOR_VERSION=7
-MOD_PATCH_VERSION=4
+MOD_MINOR_VERSION=8
+MOD_PATCH_VERSION=0
 NSPR_MODNAME=nspr20
 _HAVE_PTHREADS=
 USE_PTHREADS=
 USE_USER_PTHREADS=
 USE_NSPR_THREADS=
 USE_N32=
 USE_64=
 USE_CPLUS=
--- a/nsprpub/pr/include/md/_netbsd.cfg
+++ b/nsprpub/pr/include/md/_netbsd.cfg
@@ -47,17 +47,18 @@
 #endif
 
 #define PR_AF_INET6 24  /* same as AF_INET6 */
 
 #ifndef HAVE_LONG_LONG
 #define HAVE_LONG_LONG
 #endif
 
-#if defined(__i386__) || defined(__arm32__) || defined(__MIPSEL__)
+#if defined(__i386__) || defined(__arm32__) || defined(__ARMEL__) || \
+	defined(__MIPSEL__)
 
 #define IS_LITTLE_ENDIAN 1
 #undef  IS_BIG_ENDIAN
 #undef	HAVE_ALIGNED_DOUBLES
 #undef	HAVE_ALIGNED_LONGLONGS
 
 #define PR_BYTES_PER_BYTE   1
 #define PR_BYTES_PER_SHORT  2
@@ -92,22 +93,68 @@
 #define PR_ALIGN_OF_SHORT   2
 #define PR_ALIGN_OF_INT     4
 #define PR_ALIGN_OF_LONG    4
 #define PR_ALIGN_OF_INT64   4
 #define PR_ALIGN_OF_FLOAT   4
 #define PR_ALIGN_OF_DOUBLE  4
 #define PR_ALIGN_OF_POINTER 4
 
-#elif defined(__sparc__) || defined(__MIPSEB__)
+#elif defined(__sparc_v9__)
+
+#undef  IS_LITTLE_ENDIAN
+#define IS_BIG_ENDIAN 1
+#define HAVE_ALIGNED_DOUBLES
+#define HAVE_ALIGNED_LONGLONGS
+#define IS_64
+
+#define PR_BYTES_PER_BYTE   1
+#define PR_BYTES_PER_SHORT  2
+#define PR_BYTES_PER_INT    4
+#define PR_BYTES_PER_INT64  8
+#define PR_BYTES_PER_LONG   8
+#define PR_BYTES_PER_FLOAT  4
+#define PR_BYTES_PER_DOUBLE 8
+#define PR_BYTES_PER_WORD   8
+#define PR_BYTES_PER_DWORD  8
+#define PR_BYTES_PER_WORD_LOG2   3
+#define PR_BYTES_PER_DWORD_LOG2  3
 
-#undef IS_LITTLE_ENDIAN
-#define  IS_BIG_ENDIAN 1
-#define  HAVE_ALIGNED_DOUBLES
-#define  HAVE_ALIGNED_LONGLONGS
+#define PR_BITS_PER_BYTE    8
+#define PR_BITS_PER_SHORT   16
+#define PR_BITS_PER_INT     32
+#define PR_BITS_PER_INT64   64
+#define PR_BITS_PER_LONG    64
+#define PR_BITS_PER_FLOAT   32
+#define PR_BITS_PER_DOUBLE  64
+#define PR_BITS_PER_WORD    64
+
+#define PR_BITS_PER_BYTE_LOG2   3
+#define PR_BITS_PER_SHORT_LOG2  4
+#define PR_BITS_PER_INT_LOG2    5
+#define PR_BITS_PER_INT64_LOG2  6
+#define PR_BITS_PER_LONG_LOG2   6
+#define PR_BITS_PER_FLOAT_LOG2  5
+#define PR_BITS_PER_DOUBLE_LOG2 6
+#define PR_BITS_PER_WORD_LOG2   6
+
+#define PR_ALIGN_OF_SHORT   2
+#define PR_ALIGN_OF_INT     4
+#define PR_ALIGN_OF_LONG    8
+#define PR_ALIGN_OF_INT64   8 
+#define PR_ALIGN_OF_FLOAT   4 
+#define PR_ALIGN_OF_DOUBLE  8 
+#define PR_ALIGN_OF_POINTER 8 
+
+#elif defined(__sparc__) || defined(__MIPSEB__) || defined(__ARMEB__)
+
+#undef  IS_LITTLE_ENDIAN
+#define IS_BIG_ENDIAN 1
+#define HAVE_ALIGNED_DOUBLES
+#define HAVE_ALIGNED_LONGLONGS
 
 #define PR_BYTES_PER_BYTE   1
 #define PR_BYTES_PER_SHORT  2
 #define PR_BYTES_PER_INT    4
 #define PR_BYTES_PER_INT64  8
 #define PR_BYTES_PER_LONG   4
 #define PR_BYTES_PER_FLOAT  4
 #define PR_BYTES_PER_DOUBLE 8
@@ -183,16 +230,63 @@
 #define PR_ALIGN_OF_INT64   8
 #define PR_ALIGN_OF_FLOAT   4
 #define PR_ALIGN_OF_DOUBLE  8
 #define PR_ALIGN_OF_POINTER 8
 
 #define PR_BYTES_PER_WORD_LOG2  3
 #define PR_BYTES_PER_DWORD_LOG2 3
 
+#elif defined(__amd64__)
+#define IS_LITTLE_ENDIAN 1
+#undef  IS_BIG_ENDIAN
+#define HAVE_ALIGNED_DOUBLES
+#define HAVE_ALIGNED_LONGLONGS
+#define IS_64
+
+#define PR_BYTES_PER_BYTE   1
+#define PR_BYTES_PER_SHORT  2
+#define PR_BYTES_PER_INT    4
+#define PR_BYTES_PER_INT64  8
+#define PR_BYTES_PER_LONG   8
+#define PR_BYTES_PER_FLOAT  4
+#define PR_BYTES_PER_DOUBLE 8
+#define PR_BYTES_PER_WORD   8
+#define PR_BYTES_PER_DWORD  8
+
+#define PR_BITS_PER_BYTE    8
+#define PR_BITS_PER_SHORT   16
+#define PR_BITS_PER_INT     32
+#define PR_BITS_PER_INT64   64
+#define PR_BITS_PER_LONG    64
+#define PR_BITS_PER_FLOAT   32
+#define PR_BITS_PER_DOUBLE  64
+#define PR_BITS_PER_WORD    64
+
+#define PR_BITS_PER_BYTE_LOG2   3
+#define PR_BITS_PER_SHORT_LOG2  4
+#define PR_BITS_PER_INT_LOG2    5
+#define PR_BITS_PER_INT64_LOG2  6
+#define PR_BITS_PER_LONG_LOG2   6
+#define PR_BITS_PER_FLOAT_LOG2  5
+#define PR_BITS_PER_DOUBLE_LOG2 6
+#define PR_BITS_PER_WORD_LOG2   6
+
+#define PR_ALIGN_OF_SHORT   2
+#define PR_ALIGN_OF_INT     4
+#define PR_ALIGN_OF_LONG    8
+#define PR_ALIGN_OF_INT64   8
+#define PR_ALIGN_OF_FLOAT   4
+#define PR_ALIGN_OF_DOUBLE  8
+#define PR_ALIGN_OF_POINTER 8
+#define PR_ALIGN_OF_WORD    8
+
+#define PR_BYTES_PER_WORD_LOG2  3
+#define PR_BYTES_PER_DWORD_LOG2 3
+
 #elif defined(__powerpc__) || defined(__m68k__)
 
 #undef  IS_LITTLE_ENDIAN
 #define IS_BIG_ENDIAN    1
 #undef	HAVE_ALIGNED_DOUBLES
 #undef	HAVE_ALIGNED_LONGLONGS
 
 #define PR_BYTES_PER_BYTE   1
--- a/nsprpub/pr/include/md/_netbsd.h
+++ b/nsprpub/pr/include/md/_netbsd.h
@@ -42,16 +42,18 @@
 #include <sys/param.h>  /* for __NetBSD_Version__ */
 
 #define PR_LINKER_ARCH	"netbsd"
 #define _PR_SI_SYSNAME  "NetBSD"
 #if defined(__i386__)
 #define _PR_SI_ARCHITECTURE "x86"
 #elif defined(__alpha__)
 #define _PR_SI_ARCHITECTURE "alpha"
+#elif defined(__amd64__)
+#define _PR_SI_ARCHITECTURE "amd64"
 #elif defined(__m68k__)
 #define _PR_SI_ARCHITECTURE "m68k"
 #elif defined(__powerpc__)
 #define _PR_SI_ARCHITECTURE "powerpc"
 #elif defined(__sparc_v9__)
 #define _PR_SI_ARCHITECTURE "sparc64"
 #elif defined(__sparc__)
 #define _PR_SI_ARCHITECTURE "sparc"
@@ -87,22 +89,16 @@
 #if __NetBSD_Version__ >= 105000000
 #define _PR_INET6
 #define _PR_HAVE_INET_NTOP
 #define _PR_HAVE_GETHOSTBYNAME2
 #define _PR_HAVE_GETADDRINFO
 #define _PR_INET6_PROBE
 #endif
 
-#if __NetBSD_Version__ >= 106370000
-/* NetBSD 1.6ZK */
-#define _PR_HAVE_GETPROTO_R
-#define _PR_HAVE_GETPROTO_R_INT
-#endif
-
 #define USE_SETJMP
 
 #ifndef _PR_PTHREADS
 #include <setjmp.h>
 
 #define PR_CONTEXT_TYPE	sigjmp_buf
 
 #define CONTEXT(_th) ((_th)->md.context)
@@ -238,16 +234,20 @@ struct _MDCPU {
 #define _MD_INIT_THREAD                 _MD_InitializeThread
 #define _MD_EXIT_THREAD(thread)
 #define _MD_SUSPEND_THREAD(thread)      _MD_suspend_thread
 #define _MD_RESUME_THREAD(thread)       _MD_resume_thread
 #define _MD_CLEAN_THREAD(_thread)
 
 #endif /* ! _PR_PTHREADS */
 
+extern void _MD_EarlyInit(void);
+extern PRIntervalTime _PR_UNIX_GetInterval(void);
+extern PRIntervalTime _PR_UNIX_TicksPerSecond(void);
+
 #define _MD_EARLY_INIT                  _MD_EarlyInit
 #define _MD_FINAL_INIT			_PR_UnixInit
 #define _MD_GET_INTERVAL                  _PR_UNIX_GetInterval
 #define _MD_INTERVAL_PER_SEC              _PR_UNIX_TicksPerSecond
 
 /*
  * We wrapped the select() call.  _MD_SELECT refers to the built-in,
  * unwrapped version.
--- a/nsprpub/pr/include/prinit.h
+++ b/nsprpub/pr/include/prinit.h
@@ -58,20 +58,20 @@ PR_BEGIN_EXTERN_C
 /*
 ** NSPR's version is used to determine the likelihood that the version you
 ** used to build your component is anywhere close to being compatible with
 ** what is in the underlying library.
 **
 ** The format of the version string is
 **     "<major version>.<minor version>[.<patch level>] [<Beta>]"
 */
-#define PR_VERSION  "4.7.4 Beta"
+#define PR_VERSION  "4.8 Beta"
 #define PR_VMAJOR   4
-#define PR_VMINOR   7
-#define PR_VPATCH   4
+#define PR_VMINOR   8
+#define PR_VPATCH   0
 #define PR_BETA     PR_TRUE
 
 /*
 ** PRVersionCheck
 **
 ** The basic signature of the function that is called to provide version
 ** checking. The result will be a boolean that indicates the likelihood
 ** that the underling library will perform as the caller expects.
--- a/nsprpub/pr/src/Makefile.in
+++ b/nsprpub/pr/src/Makefile.in
@@ -196,16 +196,20 @@ endif
 ifeq ($(OS_ARCH),WINNT)
 ifdef NS_USE_GCC
 OS_LIBS		= -ladvapi32 -lwsock32 -lwinmm
 else
 OS_LIBS		= advapi32.lib wsock32.lib winmm.lib
 endif
 endif
 
+ifeq ($(OS_TARGET),WINCE)
+OS_LIBS		= ws2.lib
+endif
+
 ifeq ($(OS_TARGET),MacOSX)
 OS_LIBS		= -framework CoreServices -framework CoreFoundation
 endif
 
 ifdef GC_LEAK_DETECTOR
 EXTRA_LIBS	= -L$(dist_libdir) -lboehm
 endif
 
--- a/nsprpub/pr/src/io/prfile.c
+++ b/nsprpub/pr/src/io/prfile.c
@@ -714,17 +714,17 @@ PR_IMPLEMENT(PRStatus) PR_CreatePipe(
     PRFileDesc **readPipe,
     PRFileDesc **writePipe
 )
 {
 #if defined(XP_MAC)
 #pragma unused (readPipe, writePipe)
 #endif
 
-#ifdef WIN32
+#if defined(WIN32) && !defined(WINCE)
     HANDLE readEnd, writeEnd;
     SECURITY_ATTRIBUTES pipeAttributes;
 
     if (!_pr_initialized) _PR_ImplicitInitialization();
 
     ZeroMemory(&pipeAttributes, sizeof(pipeAttributes));
     pipeAttributes.nLength = sizeof(pipeAttributes);
     pipeAttributes.bInheritHandle = TRUE;
--- a/nsprpub/pr/src/io/prio.c
+++ b/nsprpub/pr/src/io/prio.c
@@ -40,16 +40,28 @@
 #include <string.h> /* for memset() */
 
 
 /************************************************************************/
 
 PRLock *_pr_flock_lock;
 PRCondVar *_pr_flock_cv;
 
+#ifdef WINCE
+/*
+ * There are no stdin, stdout, stderr in Windows CE.  INVALID_HANDLE_VALUE
+ * should cause all I/O functions on the handle to fail.
+ */
+static HANDLE GetStdHandle(DWORD nStdHandle)
+{
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return INVALID_HANDLE_VALUE;
+}
+#endif
+
 void _PR_InitIO(void)
 {
     const PRIOMethods *methods = PR_GetFileMethods();
 
     _PR_InitFdCache();
 
     _pr_flock_lock = PR_NewLock();
     _pr_flock_cv = PR_NewCondVar(_pr_flock_lock);
--- a/nsprpub/pr/src/io/prlog.c
+++ b/nsprpub/pr/src/io/prlog.c
@@ -94,25 +94,35 @@ static PRLock *_pr_logLock;
 /*
 ** Coerce Win32 log output to use OutputDebugString() when
 ** NSPR_LOG_FILE is set to "WinDebug".
 */
 #if defined(XP_PC)
 #define WIN32_DEBUG_FILE (FILE*)-2
 #endif
 
+#ifdef WINCE
+static void OutputDebugStringA(const char* msg) {
+    int len = MultiByteToWideChar(CP_ACP, 0, msg, -1, 0, 0);
+    WCHAR *wMsg = (WCHAR *)PR_Malloc(len * sizeof(WCHAR));
+    MultiByteToWideChar(CP_ACP, 0, msg, -1, wMsg, len);
+    OutputDebugStringW(wMsg);
+    PR_Free(wMsg);
+}
+#endif
+
 /* Macros used to reduce #ifdef pollution */
 
 #if defined(_PR_USE_STDIO_FOR_LOGGING) && defined(XP_PC)
 #define _PUT_LOG(fd, buf, nb) \
     PR_BEGIN_MACRO \
     if (logFile == WIN32_DEBUG_FILE) { \
         char savebyte = buf[nb]; \
         buf[nb] = '\0'; \
-        OutputDebugString(buf); \
+        OutputDebugStringA(buf); \
         buf[nb] = savebyte; \
     } else { \
         fwrite(buf, 1, nb, fd); \
         fflush(fd); \
     } \
     PR_END_MACRO
 #elif defined(_PR_USE_STDIO_FOR_LOGGING)
 #define _PUT_LOG(fd, buf, nb) {fwrite(buf, 1, nb, fd); fflush(fd);}
@@ -249,17 +259,17 @@ void _PR_InitLog(void)
 #endif /* XP_UNIX */
 
         ev = PR_GetEnv("NSPR_LOG_FILE");
         if (ev && ev[0]) {
             if (!PR_SetLogFile(ev)) {
 #ifdef XP_PC
                 char* str = PR_smprintf("Unable to create nspr log file '%s'\n", ev);
                 if (str) {
-                    OutputDebugString(str);
+                    OutputDebugStringA(str);
                     PR_smprintf_free(str);
                 }
 #else
                 fprintf(stderr, "Unable to create nspr log file '%s'\n", ev);
 #endif
             }
         } else {
 #ifdef _PR_USE_STDIO_FOR_LOGGING
--- a/nsprpub/pr/src/linking/prlink.c
+++ b/nsprpub/pr/src/linking/prlink.c
@@ -205,26 +205,16 @@ struct PRLibrary {
 
 static PRLibrary *pr_loadmap;
 static PRLibrary *pr_exe_loadmap;
 static PRMonitor *pr_linker_lock;
 static char* _pr_currentLibPath = NULL;
 
 static PRLibrary *pr_LoadLibraryByPathname(const char *name, PRIntn flags);
 
-#ifdef WIN95
-typedef HMODULE (WINAPI *LoadLibraryWFn)(LPCWSTR);
-static HMODULE WINAPI EmulateLoadLibraryW(LPCWSTR);
-static LoadLibraryWFn loadLibraryW = LoadLibraryW;
-#endif
-
-#ifdef WIN32
-static int pr_ConvertUTF16toUTF8(LPCWSTR wname, LPSTR name, int len);
-#endif
-
 /************************************************************************/
 
 #if !defined(USE_DLFCN) && !defined(HAVE_STRERROR)
 #define ERR_STR_BUF_LENGTH    20
 #endif
 
 static void DLLErrorInternal(PRIntn oserr)
 /*
@@ -249,22 +239,16 @@ static void DLLErrorInternal(PRIntn oser
 
 void _PR_InitLinker(void)
 {
     PRLibrary *lm = NULL;
 #if defined(XP_UNIX)
     void *h;
 #endif
 
-#ifdef WIN95
-    if (!_pr_useUnicode) {
-        loadLibraryW = EmulateLoadLibraryW;
-    }
-#endif
-
     if (!pr_linker_lock) {
         pr_linker_lock = PR_NewNamedMonitor("linker-lock");
     }
     PR_EnterMonitor(pr_linker_lock);
 
 #if defined(XP_PC)
     lm = PR_NEWZAP(PRLibrary);
     lm->name = strdup("Executable");
@@ -775,35 +759,16 @@ pr_LoadViaDyld(const char *name, PRLibra
                     linkEditError, errorNum, fileName, errorString));
         }
     }
     return (lm->dlh != NULL || lm->image != NULL) ? PR_SUCCESS : PR_FAILURE;
 }
 
 #endif /* XP_MACOSX && USE_MACH_DYLD */
 
-#ifdef WIN95
-static HMODULE WINAPI
-EmulateLoadLibraryW(LPCWSTR lpLibFileName)
-{
-    HMODULE h;
-    char nameA[MAX_PATH];
-
-    if (!WideCharToMultiByte(CP_ACP, 0, lpLibFileName, -1,
-                             nameA, sizeof nameA, NULL, NULL)) {
-        return NULL;
-    }
-    /* Perhaps it's better to add a check for characters 
-     * not representable in CP_ACP.
-     */
-    h = LoadLibraryA(nameA);
-    return h;
-}
-#endif /* WIN95 */
-
 /*
 ** Dynamically load a library. Only load libraries once, so scan the load
 ** map first.
 */
 static PRLibrary*
 pr_LoadLibraryByPathname(const char *name, PRIntn flags)
 {
     PRLibrary *lm;
@@ -833,21 +798,22 @@ pr_LoadLibraryByPathname(const char *nam
         if (wlen > MAX_PATH)
             wname = wname_malloc = PR_Malloc(wlen * sizeof(PRUnichar));
         if (wname == NULL ||
             !MultiByteToWideChar(CP_ACP, 0,  name, -1, wname, wlen)) {
             oserr = _MD_ERRNO();
             goto unlock;
         }
     }
-    len = pr_ConvertUTF16toUTF8(wname, NULL, 0);
+    len = WideCharToMultiByte(CP_UTF8, 0, wname, -1, NULL, 0, NULL, NULL);
     if (len > MAX_PATH)
         utf8name = utf8name_malloc = PR_Malloc(len);
     if (utf8name == NULL ||
-        !pr_ConvertUTF16toUTF8(wname, utf8name, len)) {
+        !WideCharToMultiByte(CP_UTF8, 0, wname, -1,
+                             utf8name, len, NULL, NULL)) {
         oserr = _MD_ERRNO();
         goto unlock;
     }
     /* the list of loaded library names are always kept in UTF-8 
      * on Win32 platforms */
     result = pr_UnlockedFindLibrary(utf8name);
 #else
     result = pr_UnlockedFindLibrary(name);
@@ -876,50 +842,32 @@ pr_LoadLibraryByPathname(const char *nam
           }
           lm->name = strdup(name);
           lm->dlh  = h;
           lm->next = pr_loadmap;
           pr_loadmap = lm;
     }
 #endif /* XP_OS2 */
 
-#if defined(WIN32) || defined(WIN16)
+#ifdef WIN32
     {
     HINSTANCE h;
 
-#ifdef WIN32
-#ifdef WIN95
-    if (flags & PR_LD_PATHW)
-        h = loadLibraryW(wname);
-    else
-        h = LoadLibraryA(name);
-#else
-    if (flags & PR_LD_PATHW)
-        h = LoadLibraryW(wname);
-    else
-        h = LoadLibraryA(name);
-#endif /* WIN95 */
-#else 
-    h = LoadLibrary(name);
-#endif
-    if (h < (HINSTANCE)HINSTANCE_ERROR) {
+    h = LoadLibraryW(wname);
+    if (h == NULL) {
         oserr = _MD_ERRNO();
         PR_DELETE(lm);
         goto unlock;
     }
-#ifdef WIN32
     lm->name = strdup(utf8name);
-#else
-    lm->name = strdup(name);
-#endif
     lm->dlh = h;
     lm->next = pr_loadmap;
     pr_loadmap = lm;
     }
-#endif /* WIN32 || WIN16 */
+#endif /* WIN32 */
 
 #if defined(XP_MACOSX) && defined(USE_MACH_DYLD)
     {
     int     i;
     PRStatus status;
 
     static const macLibraryLoadProc loadProcs[] = {
 #ifdef __ppc__
@@ -1115,135 +1063,16 @@ pr_LoadLibraryByPathname(const char *nam
         PR_Free(utf8name_malloc);
     if (wname_malloc)
         PR_Free(wname_malloc);
 #endif
     PR_ExitMonitor(pr_linker_lock);
     return result;
 }
 
-#ifdef WIN32
-#ifdef WIN95
-/*
- * CP_UTF8 is not supported by WideCharToMultiByte on Windows 95 so that 
- * we have to emulate it
- */
-static PRStatus 
-pr_ConvertSingleCharToUTF8(PRUint32 usv, PRUint16 offset, int bufLen,
-                           int *utf8Len, char * *buf)
-{
-    char* p = *buf;
-    PR_ASSERT(!bufLen || *buf);
-    if (!bufLen) {
-        *utf8Len += offset;
-        return PR_SUCCESS;
-    }
-
-    if (*utf8Len + offset >= bufLen)
-        return PR_FAILURE;
-
-    *utf8Len += offset;
-    if (offset == 1) {
-        *p++ = (char) usv;
-    } else if (offset == 2) {
-        *p++ = (char)0xc0 | (usv >> 6);
-        *p++ = (char)0x80 | (usv & 0x003f);
-    } else if (offset == 3) {
-        *p++ = (char)0xe0 | (usv >> 12);
-        *p++ = (char)0x80 | ((usv >> 6) & 0x003f);
-        *p++ = (char)0x80 | (usv & 0x003f);
-    } else { /* offset = 4 */
-        *p++ = (char)0xf0 | (usv >> 18);
-        *p++ = (char)0x80 | ((usv >> 12) & 0x003f);
-        *p++ = (char)0x80 | ((usv >> 6) & 0x003f);
-        *p++ = (char)0x80 | (usv & 0x003f);
-    }
-
-    *buf = p;
-    return PR_SUCCESS;
-}
-
-static int pr_ConvertUTF16toUTF8(LPCWSTR wname, LPSTR name, int len)
-{
-    LPCWSTR pw = wname;
-    LPSTR p = name;
-    int utf8Len = 0;
-    PRBool highSurrogate = PR_FALSE;
-
-    utf8Len = WideCharToMultiByte(CP_UTF8, 0, wname, -1, name, len, 
-                                  NULL, NULL);
-    /*
-     * Windows 95 and NT 3.51 don't support CP_UTF8.
-     * WideCharToMultiByte(CP_UTF8, ...) fails with the error code
-     * ERROR_INVALID_PARAMETER on Windows 95 and NT 3.51.
-     */
-    if (utf8Len || GetLastError() != ERROR_INVALID_PARAMETER)
-        return utf8Len;
-
-    if (!wname || len < 0 || (len > 0 && !name)) {
-        SetLastError(ERROR_INVALID_PARAMETER);
-        return 0;
-    }
-
-    while (*pw) {
-        PRStatus status = PR_SUCCESS;
-        if (highSurrogate) {
-            if (*pw >= (PRUnichar) 0xDC00 && *pw < (PRUnichar) 0xE000) {
-                /* found a matching low surrogate */
-                /* convert a surrogate pair to UCS4 */
-                PRUint32 usv = ((*(pw-1) - (PRUnichar)0xD800) << 10) + 
-                               (*pw - (PRUnichar)0xDC00) + (PRUint32)0x10000;
-                if (pr_ConvertSingleCharToUTF8(usv, 4, len, &utf8Len, &p) ==
-                    PR_FAILURE)
-                    return 0;
-                highSurrogate = PR_FALSE;
-                ++pw;
-                continue;
-            } else {
-                /*
-                 * silently ignore a lone high surrogate
-                 * as is done by WideCharToMultiByte by default
-                 */
-                highSurrogate = PR_FALSE;
-            }
-        }
-        if (*pw <= 0x7f) 
-            status = pr_ConvertSingleCharToUTF8(*pw, 1, len, &utf8Len, &p);
-        else if (*pw <= 0x07ff)
-            status = pr_ConvertSingleCharToUTF8(*pw, 2, len, &utf8Len, &p);
-        else if (*pw < (PRUnichar) 0xD800 || *pw >= (PRUnichar) 0xE000)
-            status = pr_ConvertSingleCharToUTF8(*pw, 3, len, &utf8Len, &p);
-        else if (*pw < (PRUnichar) 0xDC00)
-            highSurrogate = PR_TRUE;
-        /* else */
-        /* silently ignore a lone low surrogate as is done by 
-         * WideCharToMultiByte by default */
-
-        if (status == PR_FAILURE) {
-            SetLastError(ERROR_INSUFFICIENT_BUFFER);
-            return 0;
-        }
-        ++pw;
-    }
-
-    /* if we're concerned with a lone high surrogate,
-     * we have to take care of it here, but we just drop it 
-     */
-    if (len > 0)
-        *p = '\0';
-    return utf8Len + 1;
-}
-#else
-static int pr_ConvertUTF16toUTF8(LPCWSTR wname, LPSTR name, int len)
-{
-    return WideCharToMultiByte(CP_UTF8, 0, wname, -1, name, len, NULL, NULL);
-}
-#endif /* WIN95 */
-#endif /* WIN32 */
-
 /*
 ** Unload a shared library which was loaded via PR_LoadLibrary
 */
 PR_IMPLEMENT(PRStatus) 
 PR_UnloadLibrary(PRLibrary *lib)
 {
     int result = 0;
     PRStatus status = PR_SUCCESS;
@@ -1918,34 +1747,45 @@ PR_GetLibraryFilePathname(const char *na
         return NULL;
     }
     result = PR_Malloc(strlen(module_name)+1);
     if (result != NULL) {
         strcpy(result, module_name);
     }
     return result;
 #elif defined(WIN32)
-    HMODULE handle;
-    char module_name[MAX_PATH];
+    PRUnichar wname[MAX_PATH];
+    HMODULE handle = NULL;
+    PRUnichar module_name[MAX_PATH];
+    int len;
     char *result;
 
-    handle = GetModuleHandle(name);
+    if (MultiByteToWideChar(CP_ACP, 0, name, -1, wname, MAX_PATH)) {
+        handle = GetModuleHandleW(wname);
+    }
     if (handle == NULL) {
         PR_SetError(PR_LIBRARY_NOT_LOADED_ERROR, _MD_ERRNO());
         DLLErrorInternal(_MD_ERRNO());
         return NULL;
     }
-    if (GetModuleFileName(handle, module_name, sizeof module_name) == 0) {
+    if (GetModuleFileNameW(handle, module_name, MAX_PATH) == 0) {
         /* should not happen */
         _PR_MD_MAP_DEFAULT_ERROR(_MD_ERRNO());
         return NULL;
     }
-    result = PR_Malloc(strlen(module_name)+1);
+    len = WideCharToMultiByte(CP_ACP, 0, module_name, -1,
+                              NULL, 0, NULL, NULL);
+    if (len == 0) {
+        _PR_MD_MAP_DEFAULT_ERROR(_MD_ERRNO());
+        return NULL;
+    }
+    result = PR_Malloc(len * sizeof(PRUnichar));
     if (result != NULL) {
-        strcpy(result, module_name);
+        WideCharToMultiByte(CP_ACP, 0, module_name, -1,
+                            result, len, NULL, NULL);
     }
     return result;
 #elif defined(XP_OS2)
     HMODULE module = NULL;
     char module_name[_MAX_PATH];
     char *result;
     APIRET ulrc = DosQueryModFromEIP(&module, NULL, 0, NULL, NULL, (ULONG) addr);
     if ((NO_ERROR != ulrc) || (NULL == module) ) {
--- a/nsprpub/pr/src/md/windows/Makefile.in
+++ b/nsprpub/pr/src/md/windows/Makefile.in
@@ -57,17 +57,17 @@ CSRCS = \
     w16io.c  \
     w16gc.c  \
     w16error.c  \
     w16stdio.c  \
     w16callb.c \
     ntinrval.c \
     $(NULL)
 else
-ifeq ($(OS_TARGET), WIN95)
+ifeq (,$(filter-out WIN95 WINCE, $(OS_TARGET)))
 CSRCS =          \
     ntmisc.c \
     ntsec.c   \
     ntsem.c   \
     ntinrval.c \
     ntgc.c \
 	w95thred.c \
 	w95io.c \
--- a/nsprpub/pr/src/md/windows/ntsec.c
+++ b/nsprpub/pr/src/md/windows/ntsec.c
@@ -64,16 +64,19 @@ static struct {
 /*
  * Initialize the SIDs for owner, primary group, and the Everyone
  * group in the _pr_nt_sids structure.
  *
  * This function needs to be called by NSPR initialization.
  */
 void _PR_NT_InitSids(void)
 {
+#ifdef WINCE /* not supported */
+    return;
+#else
     SID_IDENTIFIER_AUTHORITY SIDAuthWorld = SECURITY_WORLD_SID_AUTHORITY;
     HANDLE hToken = NULL; /* initialized to an arbitrary value to
                            * silence a Purify UMR warning */
     UCHAR infoBuffer[1024];
     PTOKEN_OWNER pTokenOwner = (PTOKEN_OWNER) infoBuffer;
     PTOKEN_PRIMARY_GROUP pTokenPrimaryGroup
             = (PTOKEN_PRIMARY_GROUP) infoBuffer;
     DWORD dwLength;
@@ -123,36 +126,41 @@ void _PR_NT_InitSids(void)
     PR_ASSERT(rv != 0);
 
     /* Create a well-known SID for the Everyone group. */
     rv = AllocateAndInitializeSid(&SIDAuthWorld, 1,
             SECURITY_WORLD_RID,
             0, 0, 0, 0, 0, 0, 0,
             &_pr_nt_sids.everyone);
     PR_ASSERT(rv != 0);
+#endif
 }
 
 /*
  * Free the SIDs for owner, primary group, and the Everyone group
  * in the _pr_nt_sids structure.
  *
  * This function needs to be called by NSPR cleanup.
  */
 void
 _PR_NT_FreeSids(void)
 {
+#ifdef WINCE
+    return;
+#else
     if (_pr_nt_sids.owner) {
         PR_Free(_pr_nt_sids.owner);
     }
     if (_pr_nt_sids.group) {
         PR_Free(_pr_nt_sids.group);
     }
     if (_pr_nt_sids.everyone) {
         FreeSid(_pr_nt_sids.everyone);
     }
+#endif
 }
 
 /*
  * Construct a security descriptor whose discretionary access-control
  * list implements the specified mode bits.  The SIDs for owner, group,
  * and everyone are obtained from the global _pr_nt_sids structure.
  * Both the security descriptor and access-control list are returned
  * and should be freed by a _PR_NT_FreeSecurityDescriptorACL call.
@@ -163,16 +171,20 @@ void
  */
 PRStatus
 _PR_NT_MakeSecurityDescriptorACL(
     PRIntn mode,
     DWORD accessTable[],
     PSECURITY_DESCRIPTOR *resultSD,
     PACL *resultACL)
 {
+#ifdef WINCE
+    PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
+    return PR_FAILURE;
+#else
     PSECURITY_DESCRIPTOR pSD = NULL;
     PACL pACL = NULL;
     DWORD cbACL;  /* size of ACL */
     DWORD accessMask;
 
     if (_pr_nt_sids.owner == NULL) {
         PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
         return PR_FAILURE;
@@ -256,16 +268,17 @@ PRStatus
 failed:
     if (pSD) {
         PR_Free(pSD);
     }
     if (pACL) {
         PR_Free(pACL);
     }
     return PR_FAILURE;
+#endif
 }
 
 /*
  * Free the specified security descriptor and access-control list
  * previously created by _PR_NT_MakeSecurityDescriptorACL.
  */
 void
 _PR_NT_FreeSecurityDescriptorACL(PSECURITY_DESCRIPTOR pSD, PACL pACL)
--- a/nsprpub/pr/src/md/windows/objs.mk
+++ b/nsprpub/pr/src/md/windows/objs.mk
@@ -46,17 +46,17 @@ CSRCS = ntmisc.c \
 	ntthread.c \
 	ntdllmn.c \
 	win32_errors.c \
 	w32ipcsem.c \
 	w32poll.c \
 	w32rng.c \
 	w32shm.c
 else
-ifeq ($(OS_TARGET),WIN95)
+ifeq (,$(filter-out WIN95 WINCE, $(OS_TARGET)))
 CSRCS =	ntmisc.c \
 	ntsec.c \
 	ntsem.c \
 	ntinrval.c \
 	ntgc.c \
 	w95thred.c \
 	w95io.c \
 	w95cv.c \
--- a/nsprpub/pr/src/md/windows/w32ipcsem.c
+++ b/nsprpub/pr/src/md/windows/w32ipcsem.c
@@ -37,16 +37,40 @@
 
 /*
  * File: w32ipcsem.c
  * Description: implements named semaphores for NT and WIN95.
  */
 
 #include "primpl.h"
 
+#ifdef WINCE
+static HANDLE OpenSemaphore(DWORD inDesiredAccess,
+                            BOOL inInheritHandle,
+                            const char *inName)
+{
+    HANDLE retval = NULL;
+    HANDLE semaphore = NULL;
+    PRUnichar wideName[MAX_PATH];  /* name size is limited to MAX_PATH */
+    
+    MultiByteToWideChar(CP_ACP, 0, inName, -1, wideName, MAX_PATH);
+    /* 0x7fffffff is the max count for our semaphore */
+    semaphore = CreateSemaphoreW(NULL, 0, 0x7fffffff, wideName);
+    if (NULL != semaphore) {
+        DWORD lastErr = GetLastError();
+      
+        if (ERROR_ALREADY_EXISTS != lastErr)
+            CloseHandle(semaphore);
+        else
+            retval = semaphore;
+    }
+    return retval;
+}
+#endif
+
 /*
  * NSPR-to-NT access right mapping table for semaphore objects.
  *
  * The SYNCHRONIZE access is required by WaitForSingleObject.
  * The SEMAPHORE_MODIFY_STATE access is required by ReleaseSemaphore.
  * The OR of these three access masks must equal SEMAPHORE_ALL_ACCESS.
  * This is because if a semaphore object with the specified name
  * exists, CreateSemaphore requests SEMAPHORE_ALL_ACCESS access to
@@ -142,17 +166,26 @@ PRSem *_PR_MD_OPEN_SEMAPHORE(
     if (flags & PR_SEM_CREATE) {
         if (_PR_NT_MakeSecurityDescriptorACL(mode, semAccessTable,
                 &pSD, &pACL) == PR_SUCCESS) {
             sa.nLength = sizeof(sa);
             sa.lpSecurityDescriptor = pSD;
             sa.bInheritHandle = FALSE;
             lpSA = &sa;
         }
-        sem->sem = CreateSemaphore(lpSA, value, 0x7fffffff, osname);
+#ifdef WINCE
+        {
+            /* The size of a sem's name is limited to MAX_PATH. */
+            PRUnichar wosname[MAX_PATH]; 
+            MultiByteToWideChar(CP_ACP, 0, osname, -1, wosname, MAX_PATH);
+            sem->sem = CreateSemaphoreW(lpSA, value, 0x7fffffff, wosname);
+        }
+#else
+        sem->sem = CreateSemaphoreA(lpSA, value, 0x7fffffff, osname);
+#endif
         if (lpSA != NULL) {
             _PR_NT_FreeSecurityDescriptorACL(pSD, pACL);
         }
         if (sem->sem == NULL) {
             _PR_MD_MAP_DEFAULT_ERROR(GetLastError());
             PR_DELETE(sem);
             return NULL;
         }
--- a/nsprpub/pr/src/md/windows/w32shm.c
+++ b/nsprpub/pr/src/md/windows/w32shm.c
@@ -114,23 +114,42 @@ extern PRSharedMemory * _MD_OpenSharedMe
 
         if (_PR_NT_MakeSecurityDescriptorACL(mode, filemapAccessTable,
                 &pSD, &pACL) == PR_SUCCESS) {
             sa.nLength = sizeof(sa);
             sa.lpSecurityDescriptor = pSD;
             sa.bInheritHandle = FALSE;
             lpSA = &sa;
         }
-        shm->handle = CreateFileMapping(
+#ifdef WINCE
+        {
+            /*
+             * This is assuming that the name will never be larger than
+             * MAX_PATH.  Should we dynamically allocate?
+             */
+            PRUnichar wideIpcName[MAX_PATH];
+            MultiByteToWideChar(CP_ACP, 0, shm->ipcname, -1,
+                                wideIpcName, MAX_PATH);
+            shm->handle = CreateFileMappingW(
+                (HANDLE)-1 ,
+                lpSA,
+                flProtect,
+                dwHi,
+                dwLo,
+                wideIpcName);
+        }
+#else
+        shm->handle = CreateFileMappingA(
             (HANDLE)-1 ,
             lpSA,
             flProtect,
             dwHi,
             dwLo,
             shm->ipcname);
+#endif
         if (lpSA != NULL) {
             _PR_NT_FreeSecurityDescriptorACL(pSD, pACL);
         }
 
         if ( NULL == shm->handle ) {
             PR_LOG(_pr_shm_lm, PR_LOG_DEBUG, 
                 ( "PR_OpenSharedMemory: CreateFileMapping() failed: %s",
                     shm->ipcname )); 
@@ -151,17 +170,22 @@ extern PRSharedMemory * _MD_OpenSharedMe
             } else {
                 PR_LOG(_pr_shm_lm, PR_LOG_DEBUG, 
                     ( "PR_OpenSharedMemory: CreateFileMapping() success: %s, handle: %d",
                         shm->ipcname, shm->handle ));
                 return(shm);
             }
         }
     } else {
+#ifdef WINCE
+        PR_SetError( PR_NOT_IMPLEMENTED_ERROR, 0 );
+        shm->handle = NULL;  /* OpenFileMapping not supported */
+#else
         shm->handle = OpenFileMapping( FILE_MAP_WRITE, TRUE, shm->ipcname );
+#endif
         if ( NULL == shm->handle ) {
             _PR_MD_MAP_DEFAULT_ERROR( GetLastError());
             PR_LOG(_pr_shm_lm, PR_LOG_DEBUG, 
                 ( "PR_OpenSharedMemory: OpenFileMapping() failed: %s, error: %d",
                     shm->ipcname, PR_GetOSError())); 
             PR_FREEIF( shm->ipcname );
             PR_DELETE( shm );
             return(NULL);
--- a/nsprpub/pr/src/md/windows/w95sock.c
+++ b/nsprpub/pr/src/md/windows/w95sock.c
@@ -114,17 +114,17 @@ void _PR_MD_InitSockets(void)
 
     memset(&osvi, 0, sizeof(osvi));
     osvi.dwOSVersionInfoSize = sizeof(osvi);
     GetVersionEx(&osvi);
 
     /* if Vista or later... */
     if (osvi.dwMajorVersion >= 6)
     {
-        libWinsock2 = LoadLibrary("Ws2_32.dll");
+        libWinsock2 = LoadLibraryW(L"Ws2_32.dll");
         if (libWinsock2)
         {
             wsaioctlProc = (WSAIOCTLPROC)GetProcAddress(libWinsock2, 
                                                         "WSAIoctl");
             if (wsaioctlProc)
             {
                 socketSetCompatMode = PR_TRUE;
             }
--- a/nsprpub/pr/src/md/windows/w95thred.c
+++ b/nsprpub/pr/src/md/windows/w95thred.c
@@ -229,35 +229,45 @@ void
 void
 _PR_MD_EXIT(PRIntn status)
 {
     _exit(status);
 }
 
 PRInt32 _PR_MD_SETTHREADAFFINITYMASK(PRThread *thread, PRUint32 mask )
 {
+#ifdef WINCE
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return -1;
+#else
     DWORD_PTR rv;
 
     rv = SetThreadAffinityMask(thread->md.handle, mask);
 
     return rv?0:-1;
+#endif
 }
 
 PRInt32 _PR_MD_GETTHREADAFFINITYMASK(PRThread *thread, PRUint32 *mask)
 {
+#ifdef WINCE
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return -1;
+#else
     BOOL rv;
     DWORD_PTR process_mask;
     DWORD_PTR system_mask;
 
     rv = GetProcessAffinityMask(GetCurrentProcess(),
             &process_mask, &system_mask);
     if (rv)
         *mask = (PRUint32)process_mask;
 
     return rv?0:-1;
+#endif
 }
 
 void 
 _PR_MD_SUSPEND_CPU(_PRCPU *cpu) 
 {
     _PR_MD_SUSPEND_THREAD(cpu->thread);
 }
 
--- a/nsprpub/pr/src/misc/prsystem.c
+++ b/nsprpub/pr/src/misc/prsystem.c
@@ -308,17 +308,17 @@ PR_IMPLEMENT(PRUint64) PR_GetPhysicalMem
                            &count);
     if (result == KERN_SUCCESS)
         bytes = hInfo.max_mem;
 
 #elif defined(WIN32)
 
     /* Try to use the newer GlobalMemoryStatusEx API for Windows 2000+. */
     GlobalMemoryStatusExFn globalMemory = (GlobalMemoryStatusExFn) NULL;
-    HMODULE module = GetModuleHandle("kernel32.dll");
+    HMODULE module = GetModuleHandleW(L"kernel32.dll");
 
     if (module) {
         globalMemory = (GlobalMemoryStatusExFn)GetProcAddress(module, "GlobalMemoryStatusEx");
 
         if (globalMemory) {
             PR_MEMORYSTATUSEX memStat;
             memStat.dwLength = sizeof(memStat);
 
--- a/nsprpub/pr/tests/vercheck.c
+++ b/nsprpub/pr/tests/vercheck.c
@@ -47,20 +47,20 @@
  */
 
 #include "prinit.h"
 
 #include <stdio.h>
 #include <stdlib.h>
 
 /*
- * This release (4.7.4) is backward compatible with the
- * 4.0.x, 4.1.x, 4.2.x, 4.3.x, 4.4.x, 4.5.x, 4.6.x, 4.7,
- * 4.7.1, 4.7.2, and 4.7.3 releases.  It, of course, is
- * compatible with itself.
+ * This release (4.8) is backward compatible with the
+ * 4.0.x, 4.1.x, 4.2.x, 4.3.x, 4.4.x, 4.5.x, 4.6.x, and
+ * 4.7.x releases.  It, of course, is compatible with
+ * itself.
  */
 static char *compatible_version[] = {
     "4.0", "4.0.1", "4.1", "4.1.1", "4.1.2", "4.1.3",
     "4.2", "4.2.1", "4.2.2", "4.3", "4.4", "4.4.1",
     "4.5", "4.5.1",
     "4.6", "4.6.1", "4.6.2", "4.6.3", "4.6.4", "4.6.5",
     "4.6.6", "4.6.7", "4.6.8",
     "4.7", "4.7.1", "4.7.2", "4.7.3", PR_VERSION
@@ -73,18 +73,18 @@ static char *compatible_version[] = {
  * Any release is incompatible with future releases and
  * patches.
  */
 static char *incompatible_version[] = {
     "2.1 19980529",
     "3.0", "3.0.1",
     "3.1", "3.1.1", "3.1.2", "3.1.3",
     "3.5", "3.5.1",
-    "4.7.9",
-    "4.8", "4.8.1",
+    "4.8.9",
+    "4.9", "4.9.1",
     "10.0", "11.1", "12.14.20"
 };
 
 int main()
 {
     int idx;
     int num_compatible = sizeof(compatible_version) / sizeof(char *);
     int num_incompatible = sizeof(incompatible_version) / sizeof(char *);