]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/filefn.h
committing changes before renaming
[wxWidgets.git] / include / wx / filefn.h
index 3c69ff07588414053fac8844aa2388f4d254f4bb..269a645e829d070a674ce0ca388da71d7ec5e4bc 100644 (file)
@@ -202,7 +202,7 @@ enum wxFileKind
     // to avoid using them as they're not present in earlier versions and
     // always using the native functions spelling is easier than testing for
     // the versions
-    #if defined(__BORLANDC__) || defined(__DMC__) || defined(__WATCOMC__)
+    #if defined(__BORLANDC__) || defined(__DMC__) || defined(__WATCOMC__) || defined(__MINGW64__)
         #define wxPOSIX_IDENT(func)    ::func
     #else // by default assume MSVC-compatible names
         #define wxPOSIX_IDENT(func)    _ ## func
@@ -237,9 +237,16 @@ enum wxFileKind
     #endif
 
     #ifdef wxHAS_HUGE_FILES
-        #define   wxSeek       wxPOSIX_IDENT(lseeki64)
-        #define   wxLseek      wxPOSIX_IDENT(lseeki64)
-        #define   wxTell       wxPOSIX_IDENT(telli64)
+        #ifndef __MINGW64__
+            #define   wxSeek       wxPOSIX_IDENT(lseeki64)
+            #define   wxLseek      wxPOSIX_IDENT(lseeki64)
+            #define   wxTell       wxPOSIX_IDENT(telli64)
+        #else
+            // unfortunately, mingw-W64 is somewhat inconsistent...
+            #define   wxSeek       _lseeki64
+            #define   wxLseek      _lseeki64
+            #define   wxTell       _telli64
+        #endif
     #else // !wxHAS_HUGE_FILES
         #define   wxSeek       wxPOSIX_IDENT(lseek)
         #define   wxLseek      wxPOSIX_IDENT(lseek)
@@ -341,20 +348,31 @@ enum wxFileKind
 
     // Types: Notice that Watcom is the only compiler to have a wide char
     // version of struct stat as well as a wide char stat function variant.
-    // This was droped since OW 1.4 "for consistency across platforms".
-    #ifdef wxHAS_HUGE_FILES
-        #if wxUSE_UNICODE && wxONLY_WATCOM_EARLIER_THAN(1,4)
-            #define   wxStructStat struct _wstati64
+    // This was dropped since OW 1.4 "for consistency across platforms".
+    //
+    // Borland is also special in that it uses _stat with Unicode functions
+    // (for MSVC compatibility?) but stat with ANSI ones
+    #ifdef __BORLANDC__
+        #if wxUSE_UNICODE
+            #define wxStructStat struct _stat
         #else
-            #define   wxStructStat struct _stati64
+            #define wxStructStat struct stat
         #endif
-    #else
-        #if wxUSE_UNICODE && wxONLY_WATCOM_EARLIER_THAN(1,4)
-            #define   wxStructStat struct _wstat
+    #else // !__BORLANDC__
+        #ifdef wxHAS_HUGE_FILES
+            #if wxUSE_UNICODE && wxONLY_WATCOM_EARLIER_THAN(1,4)
+                #define wxStructStat struct _wstati64
+            #else
+                #define wxStructStat struct _stati64
+            #endif
         #else
-            #define   wxStructStat struct _stat
+            #if wxUSE_UNICODE && wxONLY_WATCOM_EARLIER_THAN(1,4)
+                #define wxStructStat struct _wstat
+            #else
+                #define wxStructStat struct _stat
+            #endif
         #endif
-    #endif
+    #endif // __BORLANDC__/!__BORLANDC__
 
     // constants (unless already defined by the user code)
     #ifdef wxHAS_UNDERSCORES_IN_POSIX_IDENTS