Index: filesys.c
===================================================================
RCS file: /home/cvspublic/apr/file_io/win32/filesys.c,v
retrieving revision 1.5
diff -u -r1.5 filesys.c
--- filesys.c   28 Dec 2001 23:50:48 -0000  1.5
+++ filesys.c   28 Jan 2002 12:14:39 -0000
@@ -120,7 +120,7 @@
 {
     char path[APR_PATH_MAX];
 #if APR_HAS_UNICODE_FS
-    if (apr_os_level >= APR_WIN_NT)
+    APR_OS_IS_UNICODE(apr_os_level)
     {
         apr_wchar_t *ignored;
         apr_wchar_t wdrive[8];
@@ -136,8 +136,9 @@
         if ((rv = unicode_to_utf8_path(path, sizeof(path), wpath)))
             return rv;
     }
-    else
 #endif
+#if APR_HAS_ANSI_FS
+    APR_OS_SUPPORT_ANSI
     {
         char *ignored;
         char drivestr[4];
@@ -148,6 +149,7 @@
         if (!GetFullPathName(drivestr, sizeof(path), path, &ignored))
             return apr_get_os_error();
     }
+#endif
     if (!(flags & APR_FILEPATH_NATIVE)) {
         for (*rootpath = path; **rootpath; ++*rootpath) {
             if (**rootpath == '\\')
@@ -162,7 +164,7 @@
 apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t *p)
 {
 #if APR_HAS_UNICODE_FS
-    if (apr_os_level >= APR_WIN_NT)
+    APR_OS_IS_UNICODE(apr_os_level)
     {
         apr_wchar_t *ignored;
         apr_wchar_t wpath[APR_PATH_MAX];
@@ -183,8 +185,9 @@
             return rv;
         *rootpath = apr_pstrdup(p, (char*)wroot);
     }
-    else
 #endif
+#if APR_HAS_ANSI_FS
+    APR_OS_SUPPORT_ANSI
     {
         char path[APR_PATH_MAX];
         char *ignored;
@@ -192,6 +195,7 @@
             return apr_get_os_error();
         *rootpath = apr_pstrdup(p, path);
     }
+#endif
     return APR_SUCCESS;
 }
 
@@ -201,7 +205,7 @@
 {
     char path[APR_PATH_MAX];
 #if APR_HAS_UNICODE_FS
-    if (apr_os_level >= APR_WIN_NT)
+    APR_OS_IS_UNICODE(apr_os_level)
     {
         apr_wchar_t wpath[APR_PATH_MAX];
         apr_status_t rv;
@@ -210,12 +214,14 @@
         if ((rv = unicode_to_utf8_path(path, sizeof(path), wpath)))
             return rv;
     }
-    else
 #endif
+#if APR_HAS_ANSI_FS
+    APR_OS_SUPPORT_ANSI
     {
         if (!GetCurrentDirectory(sizeof(path), path))
             return apr_get_os_error();
     }
+#endif
     if (!(flags & APR_FILEPATH_NATIVE)) {
         for (*rootpath = path; **rootpath; ++*rootpath) {
             if (**rootpath == '\\')
@@ -231,7 +237,7 @@
                                            apr_pool_t *p)
 {
 #if APR_HAS_UNICODE_FS
-    if (apr_os_level >= APR_WIN_NT)
+    APR_OS_IS_UNICODE(apr_os_level)
     {
         apr_wchar_t wpath[APR_PATH_MAX];
         apr_status_t rv;
@@ -241,11 +247,13 @@
         if (!SetCurrentDirectoryW(wpath))
             return apr_get_os_error();
     }
-    else
 #endif
+#if APR_HAS_ANSI_FS
+    APR_OS_SUPPORT_ANSI
     {
         if (!SetCurrentDirectory(rootpath))
             return apr_get_os_error();
     }
+#endif
     return APR_SUCCESS;
 }
