Bug 456449: Upgraded NSPR to NSPR_HEAD_20090207.
authorWan-Teh Chang <wtc@google.com>
Sat, 07 Feb 2009 11:51:41 -0800
changeset 24749 fa40e7c882fd60c1dc15d4a0b79641ef8da516d4
parent 24748 969124be3084c7772e843ab1dbf86c11a34fa217
child 24750 084c7bed387b9e8dc6a0a18d4f7ce8577b27869b
push id5214
push userwtc@google.com
push dateSat, 07 Feb 2009 19:51:40 +0000
treeherdermozilla-central@fa40e7c882fd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs456449
milestone1.9.2a1pre
Bug 456449: Upgraded NSPR to NSPR_HEAD_20090207.
nsprpub/config/rules.mk
nsprpub/pr/include/md/_win95.h
nsprpub/pr/src/md/windows/w95io.c
nsprpub/pr/src/misc/Makefile.in
--- a/nsprpub/config/rules.mk
+++ b/nsprpub/config/rules.mk
@@ -396,48 +396,49 @@ NEED_ABSOLUTE_PATH = 1
 endif
 
 ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
 NEED_ABSOLUTE_PATH = 1
 endif
 
 ifdef NEED_ABSOLUTE_PATH
 PWD := $(shell pwd)
-abspath = $(if $(findstring :,$(1)),$(1),$(if $(filter /%,$(1)),$(1),$(PWD)/$(1)))
+# The quotes allow absolute paths to contain spaces.
+pr_abspath = "$(if $(findstring :,$(1)),$(1),$(if $(filter /%,$(1)),$(1),$(PWD)/$(1)))"
 endif
 
 $(OBJDIR)/%.$(OBJ_SUFFIX): %.cpp
 	@$(MAKE_OBJDIR)
 ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
-	$(CCC) -Fo$@ -c $(CCCFLAGS) $(call abspath,$<)
+	$(CCC) -Fo$@ -c $(CCCFLAGS) $(call pr_abspath,$<)
 else
 ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINCE)
 	$(CCC) -Fo$@ -c $(CCCFLAGS) $<
 else
 ifdef NEED_ABSOLUTE_PATH
-	$(CCC) -o $@ -c $(CCCFLAGS) $(call abspath,$<)
+	$(CCC) -o $@ -c $(CCCFLAGS) $(call pr_abspath,$<)
 else
 	$(CCC) -o $@ -c $(CCCFLAGS) $<
 endif
 endif
 endif
 
 WCCFLAGS1 = $(subst /,\\,$(CFLAGS))
 WCCFLAGS2 = $(subst -I,-i=,$(WCCFLAGS1))
 WCCFLAGS3 = $(subst -D,-d,$(WCCFLAGS2))
 $(OBJDIR)/%.$(OBJ_SUFFIX): %.c
 	@$(MAKE_OBJDIR)
 ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
-	$(CC) -Fo$@ -c $(CFLAGS) $(call abspath,$<)
+	$(CC) -Fo$@ -c $(CFLAGS) $(call pr_abspath,$<)
 else
 ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINCE)
 	$(CC) -Fo$@ -c $(CFLAGS) $<
 else
 ifdef NEED_ABSOLUTE_PATH
-	$(CC) -o $@ -c $(CFLAGS) $(call abspath,$<)
+	$(CC) -o $@ -c $(CFLAGS) $(call pr_abspath,$<)
 else
 	$(CC) -o $@ -c $(CFLAGS) $<
 endif
 endif
 endif
 
 
 $(OBJDIR)/%.$(OBJ_SUFFIX): %.s
--- a/nsprpub/pr/include/md/_win95.h
+++ b/nsprpub/pr/include/md/_win95.h
@@ -155,17 +155,17 @@ struct _MDThreadStack {
 struct _MDSegment {
     PRUint32           magic;          /* for debugging */
 };
 
 #undef PROFILE_LOCKS
 
 struct _MDDir {
     HANDLE           d_hdl;
-    WIN32_FIND_DATA  d_entry;
+    WIN32_FIND_DATAA d_entry;
     PRBool           firstEntry;     /* Is this the entry returned
                                       * by FindFirstFile()? */
     PRUint32         magic;          /* for debugging */
 };
 
 #ifdef MOZ_UNICODE
 struct _MDDirUTF16 {
     HANDLE           d_hdl;
--- a/nsprpub/pr/src/md/windows/w95io.c
+++ b/nsprpub/pr/src/md/windows/w95io.c
@@ -46,16 +46,131 @@
 #include <direct.h>
 #include <mbstring.h>
 #ifdef MOZ_UNICODE
 #include <wchar.h>
 #endif /* MOZ_UNICODE */
 
 #ifdef WINCE
 
+static HANDLE CreateFileA(LPCSTR lpFileName,
+                          DWORD dwDesiredAccess,
+                          DWORD dwShareMode,
+                          LPSECURITY_ATTRIBUTES lpSecurityAttributes,
+                          DWORD dwCreationDisposition,
+                          DWORD dwFlagsAndAttributes,
+                          HANDLE hTemplateFile)
+{
+    PRUnichar wFileName[MAX_PATH];
+    MultiByteToWideChar(CP_ACP, 0, lpFileName, -1, wFileName, MAX_PATH);
+    return CreateFileW(wFileName, dwDesiredAccess, dwShareMode,
+                       lpSecurityAttributes, dwCreationDisposition,
+                       dwFlagsAndAttributes, hTemplateFile);
+}
+
+/*
+ * We seem to call FindFirstFileA and FindNextFileA just to
+ * get the file names in a directory listing.  If so, the
+ * WIN32_FIND_DATAA structure could be defined to contain
+ * just the cFileName field, and the CopyFindFileDataW2A
+ * function could just copy/convert the cFileName field.
+ */
+typedef struct _WIN32_FIND_DATAA {
+    DWORD dwFileAttributes;
+    FILETIME ftCreationTime;
+    FILETIME ftLastAccessTime;
+    FILETIME ftLastWriteTime;
+    DWORD nFileSizeHigh;
+    DWORD nFileSizeLow;
+    DWORD dwOID;
+    CHAR  cFileName[MAX_PATH];
+} WIN32_FIND_DATAA, *LPWIN32_FIND_DATAA;
+
+static void CopyFindFileDataW2A(LPWIN32_FIND_DATAW from,
+                                LPWIN32_FIND_DATAA to)
+{
+    to->dwFileAttributes = from->dwFileAttributes;
+    to->ftCreationTime = from->ftCreationTime;
+    to->ftLastAccessTime = from->ftLastAccessTime;
+    to->ftLastWriteTime = from->ftLastWriteTime;
+    to->nFileSizeHigh = from->nFileSizeHigh;
+    to->nFileSizeLow = from->nFileSizeLow;
+    to->dwOID = from->dwOID;
+    WideCharToMultiByte(CP_ACP, 0, from->cFileName, -1,
+                        to->cFileName, MAX_PATH, NULL, NULL);
+}
+
+static HANDLE FindFirstFileA(LPCSTR lpFileName,
+                             LPWIN32_FIND_DATAA lpFindFileData)
+{
+    PRUnichar wFileName[MAX_PATH];
+    HANDLE hFindFile;
+    WIN32_FIND_DATAW wFindFileData;
+    
+    MultiByteToWideChar(CP_ACP, 0, lpFileName, -1, wFileName, MAX_PATH);
+    hFindFile = FindFirstFileW(wFileName, &wFindFileData);
+    if (hFindFile != INVALID_HANDLE_VALUE) {
+        CopyFindFileDataW2A(&wFindFileData, lpFindFileData);
+    }
+    return hFindFile;
+}
+
+static BOOL FindNextFileA(HANDLE hFindFile,
+                          LPWIN32_FIND_DATAA lpFindFileData)
+{
+    WIN32_FIND_DATAW wFindFileData;
+    BOOL rv;
+
+    rv = FindNextFileW(hFindFile, &wFindFileData);
+    if (rv) {
+        CopyFindFileDataW2A(&wFindFileData, lpFindFileData);
+    }
+    return rv;
+}
+
+static BOOL GetFileAttributesExA(LPCSTR lpFileName,
+                                 GET_FILEEX_INFO_LEVELS fInfoLevelId,
+                                 LPVOID lpFileInformation)
+{
+    PRUnichar wFileName[MAX_PATH];
+    MultiByteToWideChar(CP_ACP, 0, lpFileName, -1, wFileName, MAX_PATH);
+    return GetFileAttributesExW(wFileName, fInfoLevelId, lpFileInformation);
+}
+
+static BOOL DeleteFileA(LPCSTR lpFileName)
+{
+    PRUnichar wFileName[MAX_PATH];
+    MultiByteToWideChar(CP_ACP, 0, lpFileName, -1, wFileName, MAX_PATH);
+    return DeleteFileW(wFileName);
+}
+
+static BOOL MoveFileA(LPCSTR from, LPCSTR to)
+{
+    PRUnichar wFrom[MAX_PATH];
+    PRUnichar wTo[MAX_PATH];
+    MultiByteToWideChar(CP_ACP, 0, from, -1, wFrom, MAX_PATH);
+    MultiByteToWideChar(CP_ACP, 0, to, -1, wTo, MAX_PATH);
+    return MoveFileW(wFrom, wTo);
+}
+
+static BOOL CreateDirectoryA(LPCSTR lpPathName,
+                             LPSECURITY_ATTRIBUTES lpSecurityAttributes)
+{
+    PRUnichar wPathName[MAX_PATH];
+    MultiByteToWideChar(CP_ACP, 0, lpPathName, -1, wPathName, MAX_PATH);
+    return CreateDirectoryW(wPathName, lpSecurityAttributes);
+}
+
+static BOOL RemoveDirectoryA(LPCSTR lpPathName)
+{
+    PRUnichar wPathName[MAX_PATH];
+    MultiByteToWideChar(CP_ACP, 0, lpPathName, -1, wPathName, MAX_PATH);
+    return RemoveDirectoryW(wPathName);
+}
+
 static long GetDriveType(const char *lpRootPathName)
 {
     PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
     return 0; // The drive type cannot be determined.
 }
 
 static DWORD GetFullPathName(const char *lpFileName,
                              DWORD nBufferLength,
@@ -121,32 +236,16 @@ static unsigned char *_mbsdec(const unsi
 }
 
 static unsigned char *_mbsinc(const unsigned char *inCurrent)
 {
     // needs work dft
     return (unsigned char *)(inCurrent + 1);
 }
 
-static unsigned char *_mbspbrk(const unsigned char *inString,
-                               const unsigned char *inStrCharSet)
-{
-    // needs work dft
-    return NULL;
-}
-
-static const unsigned short *_wcsdec(const unsigned short *s,
-                                     const unsigned short *p)
-{
-    // needs work dft
-  
-    p = s < p ? (const unsigned short *)(s - 1) : 0;
-    return p;
-}
-
 #endif
 
 struct _MDLock               _pr_ioq_lock;
 
 /*
  * NSPR-to-NT access right mapping table for files.
  */
 static DWORD fileAccessTable[] = {
@@ -170,26 +269,28 @@ static DWORD dirAccessTable[] = {
  * This constant is used by _PR_FileTimeToPRTime().
  */
 #if defined(__MINGW32__)
 static const PRTime _pr_filetime_offset = 116444736000000000LL;
 #else
 static const PRTime _pr_filetime_offset = 116444736000000000i64;
 #endif
 
+/* Windows CE has GetFileAttributesEx. */
+#ifndef WINCE
 typedef BOOL (WINAPI *GetFileAttributesExFn)(LPCTSTR,
                                              GET_FILEEX_INFO_LEVELS,
                                              LPVOID); 
 static GetFileAttributesExFn getFileAttributesEx;
 static void InitGetFileInfo(void);
+#endif
 
 static void InitUnicodeSupport(void);
 
 static PRBool IsPrevCharSlash(const char *str, const char *current);
-static PRBool IsPrevCharSlashW(const PRUnichar *str, const PRUnichar *current);
 
 void
 _PR_MD_INIT_IO()
 {
     WORD WSAVersion = 0x0101;
     WSADATA WSAData;
     int err;
 
@@ -218,17 +319,19 @@ void
         rv = SystemTimeToFileTime(&systime, &filetime.ft);
         PR_ASSERT(0 != rv);
         PR_ASSERT(filetime.prt == _pr_filetime_offset);
     }
 #endif /* DEBUG */
 
     _PR_NT_InitSids();
 
+#ifndef WINCE
     InitGetFileInfo();
+#endif
 
     InitUnicodeSupport();
 
     _PR_MD_InitSockets();
 }
 
 PRStatus
 _PR_MD_WAIT(PRThread *thread, PRIntervalTime ticks)
@@ -317,23 +420,23 @@ PROsfd
             flags = OPEN_ALWAYS;
     } else {
         if (osflags & PR_TRUNCATE)
             flags = TRUNCATE_EXISTING;
         else
             flags = OPEN_EXISTING;
     }
 
-    file = CreateFile(name,
-                      access,
-                      FILE_SHARE_READ|FILE_SHARE_WRITE,
-                      NULL,
-                      flags,
-                      flag6,
-                      NULL);
+    file = CreateFileA(name,
+                       access,
+                       FILE_SHARE_READ|FILE_SHARE_WRITE,
+                       NULL,
+                       flags,
+                       flag6,
+                       NULL);
     if (file == INVALID_HANDLE_VALUE) {
 		_PR_MD_MAP_OPEN_ERROR(GetLastError());
         return -1; 
 	}
 
     return (PROsfd)file;
 }
 
@@ -375,23 +478,23 @@ PROsfd
             flags = OPEN_ALWAYS;
     } else {
         if (osflags & PR_TRUNCATE)
             flags = TRUNCATE_EXISTING;
         else
             flags = OPEN_EXISTING;
     }
 
-    file = CreateFile(name,
-                      access,
-                      FILE_SHARE_READ|FILE_SHARE_WRITE,
-                      lpSA,
-                      flags,
-                      flag6,
-                      NULL);
+    file = CreateFileA(name,
+                       access,
+                       FILE_SHARE_READ|FILE_SHARE_WRITE,
+                       lpSA,
+                       flags,
+                       flag6,
+                       NULL);
     if (lpSA != NULL) {
         _PR_NT_FreeSecurityDescriptorACL(pSD, pACL);
     }
     if (file == INVALID_HANDLE_VALUE) {
 		_PR_MD_MAP_OPEN_ERROR(GetLastError());
         return -1; 
 	}
 
@@ -561,36 +664,26 @@ PRInt32
     return rv;
 }
 
 
 /* --- DIR IO ------------------------------------------------------------ */
 #define GetFileFromDIR(d)       (d)->d_entry.cFileName
 #define FileIsHidden(d)	((d)->d_entry.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN)
 
-void FlipSlashes(char *cp, size_t len)
+static void FlipSlashes(char *cp, size_t len)
 {
     while (len-- > 0) {
         if (cp[0] == '/') {
             cp[0] = PR_DIRECTORY_SEPARATOR;
         }
         cp = _mbsinc(cp);
     }
 } /* end FlipSlashes() */
 
-void FlipSlashesW(PRUnichar *cp, size_t len)
-{
-    while (len-- > 0) {
-        if (cp[0] == L'/') {
-            cp[0] = L'\\';
-        }
-        cp++;
-    }
-} /* end FlipSlashesW() */
-
 
 /*
 **
 ** Local implementations of standard Unix RTL functions which are not provided
 ** by the VC RTL.
 **
 */
 
@@ -630,17 +723,17 @@ PRStatus
      * another backslash.
      */
     if (IsPrevCharSlash(filename, filename + len)) {
         len--;
     }
     strcpy(&filename[len], "\\*.*");
     FlipSlashes( filename, strlen(filename) );
 
-    d->d_hdl = FindFirstFile( filename, &(d->d_entry) );
+    d->d_hdl = FindFirstFileA( filename, &(d->d_entry) );
     if ( d->d_hdl == INVALID_HANDLE_VALUE ) {
 		_PR_MD_MAP_OPENDIR_ERROR(GetLastError());
         return PR_FAILURE;
     }
     d->firstEntry = PR_TRUE;
     d->magic = _MD_MAGIC_DIR;
     return PR_SUCCESS;
 }
@@ -653,17 +746,17 @@ char *
     char *fileName;
 
     if ( d ) {
         while (1) {
             if (d->firstEntry) {
                 d->firstEntry = PR_FALSE;
                 rv = 1;
             } else {
-                rv = FindNextFile(d->d_hdl, &(d->d_entry));
+                rv = FindNextFileA(d->d_hdl, &(d->d_entry));
             }
             if (rv == 0) {
                 break;
             }
             fileName = GetFileFromDIR(d);
             if ( (flags & PR_SKIP_DOT) &&
                  (fileName[0] == '.') && (fileName[1] == '\0'))
                  continue;
@@ -682,17 +775,17 @@ char *
 		}
     PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
     return NULL;
 }
 
 PRInt32
 _PR_MD_DELETE(const char *name)
 {
-    if (DeleteFile(name)) {
+    if (DeleteFileA(name)) {
         return 0;
     } else {
 		_PR_MD_MAP_DELETE_ERROR(GetLastError());
         return -1;
     }
 }
 
 void
@@ -796,27 +889,16 @@ IsPrevCharSlash(const char *str, const c
     const char *prev;
 
     if (str >= current)
         return PR_FALSE;
     prev = _mbsdec(str, current);
     return (prev == current - 1) && _PR_IS_SLASH(*prev);
 }
 
-static PRBool
-IsPrevCharSlashW(const PRUnichar *str, const PRUnichar *current)
-{
-    const PRUnichar *prev;
-
-    if (str >= current)
-        return PR_FALSE;
-    prev = _wcsdec(str, current);
-    return (prev == current - 1) && _PR_IS_SLASH(*prev);
-}
-
 /*
  * IsRootDirectory --
  *
  * Return PR_TRUE if the pathname 'fn' is a valid root directory,
  * else return PR_FALSE.  The char buffer pointed to by 'fn' must
  * be writable.  During the execution of this function, the contents
  * of the buffer pointed to by 'fn' may be modified, but on return
  * the original contents will be restored.  'buflen' is the size of
@@ -895,40 +977,40 @@ IsRootDirectory(char *fn, size_t buflen)
         /* restore the 'fn' buffer */
         if (slashAdded) {
             *--p = '\0';
         }
     }
     return rv;
 }
 
+#ifndef WINCE
 /*
  * InitGetFileInfo --
  *
  * Called during IO init. Checks for the existence of the system function
  * GetFileAttributeEx, which when available is used in GETFILEINFO calls. 
  * If the routine exists, then the address of the routine is stored in the
  * variable getFileAttributesEx, which will be used to call the routine.
  */
 static void InitGetFileInfo(void)
 {
     HMODULE module;
-    module = GetModuleHandleW(L"Kernel32.dll");
+    module = GetModuleHandle("Kernel32.dll");
     if (!module) {
         PR_LOG(_pr_io_lm, PR_LOG_DEBUG,
                 ("InitGetFileInfo: GetModuleHandle() failed: %d",
                 GetLastError()));
         return;
     }
 
     getFileAttributesEx = (GetFileAttributesExFn)
             GetProcAddress(module, "GetFileAttributesExA");
 }
 
-#ifndef WINCE
 /*
  * If GetFileAttributeEx doesn't exist, we call FindFirstFile as a
  * fallback.
  */
 static BOOL
 GetFileAttributesExFB(const char *fn, WIN32_FIND_DATA *findFileData)
 {
     HANDLE hFindFile;
@@ -1001,30 +1083,38 @@ GetFileAttributesExFB(const char *fn, WI
     FindClose(hFindFile);
     return TRUE;
 }
 #endif
 
 PRInt32
 _PR_MD_GETFILEINFO64(const char *fn, PRFileInfo64 *info)
 {
+#ifdef WINCE
+    WIN32_FILE_ATTRIBUTE_DATA findFileData;
+#else
     WIN32_FIND_DATA findFileData;
+#endif
     BOOL rv;
     
     if (NULL == fn || '\0' == *fn) {
         PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
         return -1;
     }
 
+#ifdef WINCE
+    rv = GetFileAttributesExA(fn, GetFileExInfoStandard, &findFileData);
+#else
     /* GetFileAttributesEx is supported on Win 2K and up. */
     if (getFileAttributesEx) {
         rv = getFileAttributesEx(fn, GetFileExInfoStandard, &findFileData);
     } else {
         rv = GetFileAttributesExFB(fn, &findFileData);
     }
+#endif
     if (!rv) {
         _PR_MD_MAP_OPENDIR_ERROR(GetLastError());
         return -1;
     }
 
     if (findFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
         info->type = PR_FILE_DIRECTORY;
     } else {
@@ -1157,17 +1247,17 @@ void
     }
 #endif
 }
 
 PRInt32
 _PR_MD_RENAME(const char *from, const char *to)
 {
     /* Does this work with dot-relative pathnames? */
-    if (MoveFile(from, to)) {
+    if (MoveFileA(from, to)) {
         return 0;
     } else {
 		_PR_MD_MAP_RENAME_ERROR(GetLastError());
         return -1;
     }
 }
 
 PRInt32
@@ -1197,17 +1287,17 @@ PRInt32 rv;
     return rv;
 #endif
 }
 
 PRInt32
 _PR_MD_MKDIR(const char *name, PRIntn mode)
 {
     /* XXXMB - how to translate the "mode"??? */
-    if (CreateDirectory(name, NULL)) {
+    if (CreateDirectoryA(name, NULL)) {
         return 0;
     } else {
 		_PR_MD_MAP_MKDIR_ERROR(GetLastError());
         return -1;
     }
 }
 
 PRInt32
@@ -1221,32 +1311,32 @@ PRInt32
 
     if (_PR_NT_MakeSecurityDescriptorACL(mode, dirAccessTable,
             &pSD, &pACL) == PR_SUCCESS) {
         sa.nLength = sizeof(sa);
         sa.lpSecurityDescriptor = pSD;
         sa.bInheritHandle = FALSE;
         lpSA = &sa;
     }
-    rv = CreateDirectory(name, lpSA);
+    rv = CreateDirectoryA(name, lpSA);
     if (lpSA != NULL) {
         _PR_NT_FreeSecurityDescriptorACL(pSD, pACL);
     }
     if (rv) {
         return 0;
     } else {
         _PR_MD_MAP_MKDIR_ERROR(GetLastError());
         return -1;
     }
 }
 
 PRInt32
 _PR_MD_RMDIR(const char *name)
 {
-    if (RemoveDirectory(name)) {
+    if (RemoveDirectoryA(name)) {
         return 0;
     } else {
 		_PR_MD_MAP_RMDIR_ERROR(GetLastError());
         return -1;
     }
 }
 
 PRStatus
@@ -1353,16 +1443,25 @@ static void InitUnicodeSupport(void)
         _pr_useUnicode = PR_FALSE;
 #endif
 #endif
 }
 
 #ifdef MOZ_UNICODE
 
 /* ================ UTF16 Interfaces ================================ */
+static void FlipSlashesW(PRUnichar *cp, size_t len)
+{
+    while (len-- > 0) {
+        if (cp[0] == L'/') {
+            cp[0] = L'\\';
+        }
+        cp++;
+    }
+} /* end FlipSlashesW() */
 
 PROsfd
 _PR_MD_OPEN_FILE_UTF16(const PRUnichar *name, PRIntn osflags, int mode)
 {
     HANDLE file;
     PRInt32 access = 0;
     PRInt32 flags = 0;
     PRInt32 flag6 = 0;
--- a/nsprpub/pr/src/misc/Makefile.in
+++ b/nsprpub/pr/src/misc/Makefile.in
@@ -89,19 +89,19 @@ include $(topsrcdir)/config/rules.mk
 # Prevent floating point errors caused by MSVC 6.0 Processor Pack
 # optimizations (bug 207421).  This disables optimizations that
 # could change the precision of floating-point calculations for
 # this single compilation unit.
 ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
 $(OBJDIR)/prdtoa.$(OBJ_SUFFIX): prdtoa.c
 	@$(MAKE_OBJDIR)
 ifeq (,$(filter-out 1100 1200 1300 1310,$(MSC_VER)))
-	$(CC) -Fo$@ -c $(CFLAGS) -Op $(call abspath,$<)
+	$(CC) -Fo$@ -c $(CFLAGS) -Op $(call pr_abspath,$<)
 else
-	$(CC) -Fo$@ -c $(CFLAGS) -fp:precise $(call abspath,$<)
+	$(CC) -Fo$@ -c $(CFLAGS) -fp:precise $(call pr_abspath,$<)
 endif
 endif
 
 #
 # Generate prerr.h, prerr.c, and prerr.properties from prerr.et.
 #
 build_prerr:
 	cd $(srcdir); $(PERL) compile-et.pl prerr.et