]> git.saurik.com Git - wxWidgets.git/commitdiff
build fixes for Borland in wxUSE_UNICODE_MSLU and wxHAS_HUGE_FILES cases; only define...
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 25 Apr 2009 13:52:58 +0000 (13:52 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 25 Apr 2009 13:52:58 +0000 (13:52 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60345 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/filefn.h
src/msw/mslu.cpp

index 427eb1974b6a0f21303f00b908004c89a471d855..892db0ec6f1055b484d4b8a8a050f1ec1d2b9202 100644 (file)
@@ -187,6 +187,8 @@ enum wxFileKind
     // huge file support (or at least not all functions needed for it by wx)
     // currently
 
+    // types
+
     #ifdef wxHAS_HUGE_FILES
         typedef wxLongLong_t wxFileOffset;
         #define wxFileOffsetFmtSpec wxLongLongFmtSpec
@@ -194,6 +196,46 @@ enum wxFileKind
         typedef off_t wxFileOffset;
     #endif
 
+    // at least Borland 5.5 doesn't like "struct ::stat" so don't use the scope
+    // resolution operator present in wxPOSIX_IDENT for it
+    #ifdef __BORLANDC__
+        #define wxPOSIX_STRUCT(s)    struct s
+    #else
+        #define wxPOSIX_STRUCT(s)    struct wxPOSIX_IDENT(s)
+    #endif
+
+    // 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 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 wxHAS_HUGE_FILES
+            #define wxStructStat struct stati64
+        #else
+            #if wxUSE_UNICODE
+                #define wxStructStat struct _stat
+            #else
+                #define wxStructStat struct stat
+            #endif
+        #endif
+    #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
+            #if wxUSE_UNICODE && wxONLY_WATCOM_EARLIER_THAN(1,4)
+                #define wxStructStat struct _wstat
+            #else
+                #define wxStructStat struct _stat
+            #endif
+        #endif
+    #endif // __BORLANDC__/!__BORLANDC__
+
 
     // functions
 
@@ -210,14 +252,6 @@ enum wxFileKind
         #define wxHAS_UNDERSCORES_IN_POSIX_IDENTS
     #endif
 
-    // at least Borland 5.5 doesn't like "struct ::stat" so don't use the scope
-    // resolution operator present in wxPOSIX_IDENT for it
-    #ifdef __BORLANDC__
-        #define wxPOSIX_STRUCT(s)    struct s
-    #else
-        #define wxPOSIX_STRUCT(s)    struct wxPOSIX_IDENT(s)
-    #endif
-
     // first functions not working with strings, i.e. without ANSI/Unicode
     // complications
     #define   wxClose      wxPOSIX_IDENT(close)
@@ -285,11 +319,13 @@ enum wxFileKind
                 WXDLLIMPEXP_BASE int wxMSLU__wmkdir(const wxChar *name);
                 WXDLLIMPEXP_BASE int wxMSLU__wrmdir(const wxChar *name);
 
-                WXDLLIMPEXP_BASE int
-                wxMSLU__wstat(const wxChar *name, wxPOSIX_STRUCT(stat) *buffer);
-                WXDLLIMPEXP_BASE int
-                wxMSLU__wstati64(const wxChar *name,
-                                 wxPOSIX_STRUCT(stati64) *buffer);
+                #ifdef wxHAS_HUGE_FILES
+                    WXDLLIMPEXP_BASE int
+                    wxMSLU__wstati64(const wxChar *name, wxStructStat *buffer);
+                #else // !wxHAS_HUGE_FILES
+                    WXDLLIMPEXP_BASE int
+                    wxMSLU__wstat(const wxChar *name, wxStructStat *buffer);
+                #endif // wxHAS_HUGE_FILES/!wxHAS_HUGE_FILES
             #endif // Windows compilers with MSLU support
 
             #define   wxCRT_Open       wxMSLU__wopen
@@ -347,34 +383,6 @@ enum wxFileKind
         #endif
     #endif // wxUSE_UNICODE/!wxUSE_UNICODE
 
-    // 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 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 stat
-        #endif
-    #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
-            #if wxUSE_UNICODE && wxONLY_WATCOM_EARLIER_THAN(1,4)
-                #define wxStructStat struct _wstat
-            #else
-                #define wxStructStat struct _stat
-            #endif
-        #endif
-    #endif // __BORLANDC__/!__BORLANDC__
-
     // constants (unless already defined by the user code)
     #ifdef wxHAS_UNDERSCORES_IN_POSIX_IDENTS
         #ifndef O_RDONLY
index 65ab5f9630b3bc528f809ec6d4009c0a9be61278..5d30eac70508145009912cf5bbe5663030c15ff6 100644 (file)
@@ -223,33 +223,24 @@ WXDLLIMPEXP_BASE int wxMSLU__wrmdir(const wchar_t *name)
         return _wrmdir(name);
 }
 
-WXDLLIMPEXP_BASE int wxMSLU__wstat(const wchar_t *name, struct _stat *buffer)
+#ifdef wxHAS_HUGE_FILES
+WXDLLIMPEXP_BASE int wxMSLU__wstati64(const wchar_t *name, wxStructStat *buffer)
 {
     if ( wxUsingUnicowsDll() )
-        return _stat((const char*)wxConvFile.cWX2MB(name), buffer);
-    else
-        return _wstat(name, buffer);
-}
-
-#ifdef __BORLANDC__
-//here _stati64 is defined as stati64, see wx/filefn.h
-#undef _stati64
-WXDLLIMPEXP_BASE int wxMSLU__wstati64(const wchar_t *name, struct _stati64 *buffer)
- {
-     if ( wxUsingUnicowsDll() )
-        return _stati64((const char*)wxConvFile.cWX2MB(name), (stati64 *) buffer);
+        return _stati64((const char*)wxConvFile.cWX2MB(name), buffer);
     else
-        return _wstati64(name, (stati64 *) buffer);
+        return _wstati64(name, buffer);
 }
-#else
-WXDLLIMPEXP_BASE int wxMSLU__wstati64(const wchar_t *name, struct _stati64 *buffer)
+#else // !wxHAS_HUGE_FILES
+WXDLLIMPEXP_BASE int wxMSLU__wstat(const wchar_t *name, wxStructStat *buffer)
 {
     if ( wxUsingUnicowsDll() )
-        return _stati64((const char*)wxConvFile.cWX2MB(name), buffer);
+        return _stat((const char*)wxConvFile.cWX2MB(name), buffer);
     else
-        return _wstati64(name, buffer);
+        return _wstat(name, buffer);
 }
-#endif //__BORLANDC__
+
+#endif // wxHAS_HUGE_FILES/!wxHAS_HUGE_FILES
 
 #endif // compilers having wopen() &c