#elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x500)
/* Borland 5.0+ supports bool */
#define HAVE_BOOL
- #elif defined(__WATCOMC__) && (__WATCOMC__ >= 1100)
+ #elif wxCHECK_WATCOM_VERSION(1,0)
/* Watcom 11+ supports bool */
#define HAVE_BOOL
#elif defined(__DIGITALMARS__)
#define except(x) catch(...)
#endif /* Metrowerks */
-#if defined(__WATCOMC__) && (__WATCOMC__ < 1240)
+#if wxONLY_WATCOM_EARLIER_THAN(1,4)
typedef short mode_t;
#endif
#if defined(__PALMOS__) && !defined(HAVE_SSIZE_T)
#define HAVE_SSIZE_T
#endif
-#if defined(__WATCOMC__) && __WATCOMC__ > 1230
+#if wxCHECK_WATCOM_VERSION(1,4)
#define HAVE_SSIZE_T
#endif
#ifndef HAVE_SSIZE_T
// version of struct stat as well as a wide char stat function variant.
// This was droped since OW 1.4 "for consistency across platforms".
#if wxHAS_HUGE_FILES
- #if wxUSE_UNICODE && defined(__WATCOMC__) && __WATCOMC__ < 1240
+ #if wxUSE_UNICODE && wxONLY_WATCOM_EARLIER_THAN(1,4)
#define wxStructStat struct _wstati64
#else
#define wxStructStat struct _stati64
#endif
#else
- #if wxUSE_UNICODE && defined(__WATCOMC__) && __WATCOMC__ < 1240
+ #if wxUSE_UNICODE && wxONLY_WATCOM_EARLIER_THAN(1,4)
#define wxStructStat struct _wstat
#else
#define wxStructStat struct _stat
#endif
#ifndef wxUSE_NORLANDER_HEADERS
-# if (defined(__WATCOMC__) && (__WATCOMC__ >= 1200)) || defined(__WINE__) || ((defined(__MINGW32__) || defined(__CYGWIN__)) && ((__GNUC__>2) ||((__GNUC__==2) && (__GNUC_MINOR__>=95))))
+# if ( wxCHECK_WATCOM_VERSION(1,0) || defined(__WINE__) ) || \
+ ((defined(__MINGW32__) || defined(__CYGWIN__)) && ((__GNUC__>2) ||((__GNUC__==2) && (__GNUC_MINOR__>=95))))
# define wxUSE_NORLANDER_HEADERS 1
# else
# define wxUSE_NORLANDER_HEADERS 0
# define wxUSE_DEBUG_NEW_ALWAYS 0
#endif
-/* Early Watcom version don't have good enough wide char support */
-#if defined(__WXMSW__) && (defined(__WATCOMC__) && __WATCOMC__ < 1200)
-# undef wxUSE_WCHAR_T
-# define wxUSE_WCHAR_T 0
-#endif
-
/* DMC++ doesn't have definitions for date picker control, so use generic control
*/
#ifdef __DMC__
#endif /* wxUSE_DYNAMIC_LOADER */
#endif /* _WX_MSW_CHKCONF_H_ */
-
#endif
#endif
-#if (defined(__WATCOMC__) && __WATCOMC__ >= 1200)
+#if wxCHECK_WATCOM_VERSION(1,0)
#define HAVE_W32API_H
#endif
#define INCL_WIN
#include <os2.h>
-#if defined(__WATCOMC__) && ( __WATCOMC__ < 1240 )
- // missing in OpenWatcom 1.3 but added in 1.4
+#if wxONLY_WATCOM_EARLIER_THAN(1,4)
inline HATOMTBL APIENTRY WinQuerySystemAtomTable(VOID){return NULL;}
inline ULONG APIENTRY WinQueryAtomName(HATOMTBL,ATOM,PCSZ,ULONG){return 0;}
inline LONG APIENTRY GpiPointArc(HPS,PPOINTL){return GPI_ERROR;}
#endif
#ifndef wxUSE_NORLANDER_HEADERS
-#if (defined(__WATCOMC__) && (__WATCOMC__ >= 1200)) || defined(__WINE__) || ((defined(__MINGW32__) || defined(__CYGWIN__)) && ((__GNUC__>2) ||((__GNUC__==2) && (__GNUC_MINOR__>=95))))
+#if (defined(__WINE__) || ((defined(__MINGW32__) || defined(__CYGWIN__)) && ((__GNUC__>2) ||((__GNUC__==2) && (__GNUC_MINOR__>=95))))
# define wxUSE_NORLANDER_HEADERS 1
#else
# define wxUSE_NORLANDER_HEADERS 0
#endif
/* _WX_PALMOS_CHKCONF_H_ */
-
#endif
+/*
+ This macro can be used to test the Open Watcom version.
+*/
+#ifndef __WATCOMC__
+# define wxWATCOM_VERSION(major,minor) 0
+# define wxCHECK_WATCOM_VERSION(major,minor) 0
+# define wxONLY_WATCOM_EARLIER_THAN(major,minor) 0
+#elif defined(__WATCOMC__) && __WATCOMC__ < 1200
+# error "Only Open Watcom is supported in this release"
+#else
+# define wxWATCOM_VERSION(major,minor) ( major * 100 + minor * 10 + 1100 )
+# define wxCHECK_WATCOM_VERSION(major,minor) ( __WATCOMC__ >= wxWATCOM_VERSION(major,minor) )
+# define wxONLY_WATCOM_EARLIER_THAN(major,minor) ( __WATCOMC__ < wxWATCOM_VERSION(major,minor) )
+#endif
+
/*
check the consistency of the settings in setup.h: note that this must be
done after setting wxUSE_UNICODE correctly as it is used in wx/chkconf.h
# define __VISUALC__ _MSC_VER
# elif defined(__BCPLUSPLUS__) && !defined(__BORLANDC__)
# define __BORLANDC__
-# elif defined(__WATCOMC__)
+# elif defined(__WATCOMC__)
# elif defined(__SC__)
# define __SYMANTECC__
# endif /* compiler */
*/
#if ( defined( __GNUWIN32__ ) || defined( __MINGW32__ ) || \
( defined( __CYGWIN__ ) && defined( __WINDOWS__ ) ) || \
- (defined(__WATCOMC__) && __WATCOMC__ >= 1200) ) && \
+ wxCHECK_WATCOM_VERSION(1,0) ) && \
!defined(__DOS__) && \
!defined(__WXPM__) && \
!defined(__WXMOTIF__) && \
/////////////////////////////////////////////////////////////////////////////
-// Name: filefn.cpp
+// Name: src/common/filefn.cpp
// Purpose: File- and directory-related functions
// Author: Julian Smart
// Modified by:
{
// Note: The watcom rtl dll doesn't have fileno (the static lib does).
// Should be fixed in version 1.4.
-#if defined(wxFILEKIND_STUB) || \
- (defined(__WATCOMC__) && __WATCOMC__ <= 1230 && defined(__SW_BR))
+#if defined(wxFILEKIND_STUB) || wxONLY_WATCOM_EARLIER_THAN(1,4)
(void)fp;
return wxFILE_KIND_DISK;
#else
/////////////////////////////////////////////////////////////////////////////
-// Name: imagjpeg.cpp
+// Name: src/common/imagjpeg.cpp
// Purpose: wxImage JPEG handler
// Author: Vaclav Slavik
// RCS-ID: $Id$
// This causes a conflict with jmorecfg.h header from libjpeg, so we have
// to make sure libjpeg won't try to define boolean itself. This is done by
// defining HAVE_BOOLEAN.
-#if defined(__WXMSW__) && (defined(__MWERKS__) || defined(__DIGITALMARS__) || (defined(__WATCOMC__) && __WATCOMC__ < 1200))
+#if defined(__WXMSW__) && (defined(__MWERKS__) || defined(__DIGITALMARS__))
#define HAVE_BOOLEAN
#include "wx/msw/wrapwin.h"
#endif
#endif // wxUSE_STREAMS
#endif // wxUSE_LIBJPEG
-
-
-
-
-
-
#if wxUSE_STREAMS
#ifndef PNGLINKAGEMODE
- #if defined(__WATCOMC__) && ( defined(__WXMSW__) || __WATCOMC__ > 1230 )
+ #if defined(__WATCOMC__) && defined(__WXMSW__)
// we need an explicit cdecl for Watcom, at least according to
//
// http://sf.net/tracker/index.php?func=detail&aid=651492&group_id=9863&atid=109863
? wxTextFileType_##t1 \
: wxTextFileType_##t2
- // Watcom C++ doesn't seem to be able to handle the macro
- // VS: Watcom 11 doesn't have a problem...
-#if !(defined(__WATCOMC__) && (__WATCOMC__ < 1100))
+#if !defined(__WATCOMC__) || wxCHECK_WATCOM_VERSION(1,4)
if ( nDos > nUnix )
return GREATER_OF(Dos, Mac);
else if ( nDos < nUnix )