try to simplify the web of ifdefs; add Borland to the list of Windows compilers (partially addresses bug 1173702)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42300 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2006-10-23 20:39:09 +00:00
parent 886b7d745c
commit dedcebb9df

View File

@@ -155,30 +155,28 @@ enum wxFileKind
#define wxRmDir _wrmdir #define wxRmDir _wrmdir
#define wxStat _wstat #define wxStat _wstat
#define wxStructStat struct _stat #define wxStructStat struct _stat
#elif defined(__WXMSW__) && !defined(__WXPALMOS__) && \
// Microsoft compiler loves underscores, feed them to it ( \
#elif defined( __VISUALC__ ) \ defined(__VISUALC__) || \
|| ( defined(__MINGW32__) && !defined(__WINE__) && wxCHECK_W32API_VERSION( 0, 5 ) ) \ (defined(__MINGW32__) && !defined(__WINE__) && \
|| ( defined(__MWERKS__) && defined(__WXMSW__) ) \ wxCHECK_W32API_VERSION(0, 5)) || \
|| ( defined(__DMC__) && defined(__WXMSW__) ) \ defined(__MWERKS__) || \
|| ( defined(__WATCOMC__) && defined(__WXMSW__) ) defined(__DMC__) || \
defined(__WATCOMC__) || \
// detect compilers which have support for huge files (currently only defined(__BORLANDC__) \
// Digital Mars doesn't) )
#ifndef __WXPALMOS__
#include "wx/msw/private.h"
#endif
#undef wxHAS_HUGE_FILES #undef wxHAS_HUGE_FILES
#if defined(__MINGW32__)
// detect compilers which have support for huge files (notice that the
// first case covers MSVC, so we don't have to test for it explicitly)
#if ((_INTEGRAL_MAX_BITS >= 64) || defined(_LARGE_FILES))
#define wxHAS_HUGE_FILES 1 #define wxHAS_HUGE_FILES 1
#elif defined(__MWERKS__) #elif defined(__MINGW32__)
#define wxHAS_HUGE_FILES 0
#elif defined(__DMC__)
#define wxHAS_HUGE_FILES 0
#elif ((_INTEGRAL_MAX_BITS >= 64) || defined(_LARGE_FILES))
#define wxHAS_HUGE_FILES 1 #define wxHAS_HUGE_FILES 1
#else #else
// DMC, Watcom, Metrowerks and Borland don't have huge file support (or
// at least not all functions needed for it by wx) currently
#define wxHAS_HUGE_FILES 0 #define wxHAS_HUGE_FILES 0
#endif #endif
@@ -211,20 +209,22 @@ enum wxFileKind
#define wxRead ::read #define wxRead ::read
#define wxWrite ::write #define wxWrite ::write
#else #else
#define wxRead _read #define wxRead _read
#define wxWrite _write #define wxWrite _write
#endif #endif
#endif #endif
#if wxHAS_HUGE_FILES #if wxHAS_HUGE_FILES
#define wxSeek _lseeki64 #define wxSeek _lseeki64
#define wxLseek _lseeki64 #define wxLseek _lseeki64
#define wxTell _telli64 #define wxTell _telli64
#else #else // !wxHAS_HUGE_FILES
#define wxSeek _lseek #define wxSeek _lseek
#define wxLseek _lseek #define wxLseek _lseek
#define wxTell _tell #define wxTell _tell
#endif #endif // wxHAS_HUGE_FILES/!wxHAS_HUGE_FILES
#define wxFsync _commit #define wxFsync _commit
#if defined(__WATCOMC__) #if defined(__WATCOMC__)
#define wxEof ::eof #define wxEof ::eof
#else #else
@@ -272,7 +272,7 @@ enum wxFileKind
#else #else
#define wxStat _stat #define wxStat _stat
#endif #endif
#endif #endif // wxUSE_UNICODE/!wxUSE_UNICODE
// Types: Notice that Watcom is the only compiler to have a wide char // 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. // version of struct stat as well as a wide char stat function variant.
@@ -292,7 +292,7 @@ enum wxFileKind
#endif #endif
// constants (unless already defined by the user code) // constants (unless already defined by the user code)
#if !defined(__BORLANDC__) && !defined(__WATCOMC__) && !defined(__WXPALMOS__) #if !defined(__BORLANDC__) && !defined(__WATCOMC__)
#ifndef O_RDONLY #ifndef O_RDONLY
#define O_RDONLY _O_RDONLY #define O_RDONLY _O_RDONLY
#define O_WRONLY _O_WRONLY #define O_WRONLY _O_WRONLY
@@ -317,10 +317,10 @@ enum wxFileKind
#define WXFILE_LARGEFILE 1 #define WXFILE_LARGEFILE 1
#endif #endif
#endif #endif
// It's a private define, undefine it so nobody gets tempted to use it // it's a private define, undefine it so that nobody gets tempted to use it
#undef wxHAS_HUGE_FILES #undef wxHAS_HUGE_FILES
#else // Unix platforms using configure #else // Unix or Windows using unknown compiler, assume POSIX supported
typedef off_t wxFileOffset; typedef off_t wxFileOffset;
#ifdef _LARGE_FILES #ifdef _LARGE_FILES
#define wxFileOffsetFmtSpec wxLongLongFmtSpec #define wxFileOffsetFmtSpec wxLongLongFmtSpec
@@ -369,7 +369,7 @@ enum wxFileKind
#define wxAccess access #define wxAccess access
#endif #endif
#define wxHAVE_NATIVE_LSTAT #define wxHAS_NATIVE_LSTAT
#endif // platforms #endif // platforms
#ifdef O_BINARY #ifdef O_BINARY
@@ -380,7 +380,7 @@ enum wxFileKind
// if the platform doesn't have symlinks, define wxLstat to be the same as // if the platform doesn't have symlinks, define wxLstat to be the same as
// wxStat to avoid #ifdefs in the code using it // wxStat to avoid #ifdefs in the code using it
#ifndef wxHAVE_NATIVE_LSTAT #ifndef wxHAS_NATIVE_LSTAT
#define wxLstat wxStat #define wxLstat wxStat
#endif #endif