Macros for simplified testing Open Watcom version and required tweaks.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36155 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba 2005-11-10 16:16:05 +00:00
parent 2a2d7a737d
commit 6d3d756a6a
11 changed files with 33 additions and 35 deletions

View File

@ -146,7 +146,7 @@
#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__)
@ -609,7 +609,7 @@ typedef int wxWindowID;
#define except(x) catch(...)
#endif /* Metrowerks */
#if defined(__WATCOMC__) && (__WATCOMC__ < 1240)
#if wxONLY_WATCOM_EARLIER_THAN(1,4)
typedef short mode_t;
#endif
@ -1006,7 +1006,7 @@ inline void *wxUIntToPtr(wxUIntPtr p)
#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

View File

@ -278,13 +278,13 @@ enum wxFileKind
// 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

View File

@ -37,7 +37,8 @@
#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
@ -167,12 +168,6 @@
# 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__
@ -243,4 +238,3 @@
#endif /* wxUSE_DYNAMIC_LOADER */
#endif /* _WX_MSW_CHKCONF_H_ */

View File

@ -32,7 +32,7 @@
#endif
#endif
#if (defined(__WATCOMC__) && __WATCOMC__ >= 1200)
#if wxCHECK_WATCOM_VERSION(1,0)
#define HAVE_W32API_H
#endif

View File

@ -24,8 +24,7 @@
#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;}

View File

@ -36,7 +36,7 @@
#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
@ -106,4 +106,3 @@
#endif
/* _WX_PALMOS_CHKCONF_H_ */

View File

@ -251,6 +251,21 @@
#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
@ -446,7 +461,7 @@
# define __VISUALC__ _MSC_VER
# elif defined(__BCPLUSPLUS__) && !defined(__BORLANDC__)
# define __BORLANDC__
# elif defined(__WATCOMC__)
# elif defined(__WATCOMC__)
# elif defined(__SC__)
# define __SYMANTECC__
# endif /* compiler */
@ -517,7 +532,7 @@
*/
#if ( defined( __GNUWIN32__ ) || defined( __MINGW32__ ) || \
( defined( __CYGWIN__ ) && defined( __WINDOWS__ ) ) || \
(defined(__WATCOMC__) && __WATCOMC__ >= 1200) ) && \
wxCHECK_WATCOM_VERSION(1,0) ) && \
!defined(__DOS__) && \
!defined(__WXPM__) && \
!defined(__WXMOTIF__) && \

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////
// Name: filefn.cpp
// Name: src/common/filefn.cpp
// Purpose: File- and directory-related functions
// Author: Julian Smart
// Modified by:
@ -1978,8 +1978,7 @@ wxFileKind wxGetFileKind(FILE *fp)
{
// 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

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////
// Name: imagjpeg.cpp
// Name: src/common/imagjpeg.cpp
// Purpose: wxImage JPEG handler
// Author: Vaclav Slavik
// RCS-ID: $Id$
@ -29,7 +29,7 @@
// 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
@ -420,9 +420,3 @@ bool wxJPEGHandler::DoCanRead( wxInputStream& stream )
#endif // wxUSE_STREAMS
#endif // wxUSE_LIBJPEG

View File

@ -105,7 +105,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxPNGHandler,wxImageHandler)
#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

View File

@ -248,9 +248,7 @@ wxTextFileType wxTextBuffer::GuessType() const
? 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 )