// ----------------------------------------------------------------------------
// OS
-#if defined(__HPUX__) || defined(____SVR4____) || defined(__LINUX__) || defined(__sgi ) || defined(__unix__)
+#if defined(__unix) || defined(__unix__) || defined(____SVR4____) || \
+ defined(__LINUX__) || defined(__sgi ) || \
+ defined(__hpux) || defined(sun) || defined(__SUN__)
+
#ifndef __UNIX__
#define __UNIX__
#endif // Unix
#endif // Sun CC
#endif
#endif // Sun
+
+ #ifdef __hpux
+ #define __HPUX__
+ #endif // HP-UX
+
#elif defined(applec) || defined(THINK_C) || ( defined( __MWERKS__ ) && !defined(__INTEL__) )
- // MacOS
+ // MacOS
#else // Windows
#ifndef __WINDOWS__
#define __WINDOWS__
// suppress some Visual C++ warnings
#ifdef __VISUALC__
-# pragma warning(disable:4244) // cobversion from double to float
+# pragma warning(disable:4244) // conversion from double to float
# pragma warning(disable:4100) // unreferenced formal parameter
-#endif
+#endif // __VISUALC__
// suppress some Salford C++ warnings
#ifdef __SALFORDC__
# pragma suppress 61 // enum has no name (doesn't suppress!)
# pragma suppress 106 // unnamed, unused parameter
# pragma suppress 571 // Virtual function hiding
-#endif
+#endif // __SALFORDC__
+
+// Digital Unix C++ compiler only defines this symbol for .cxx and .hxx files,
+// so define it ourselves
+#ifdef __DECCXX
+ #define __cplusplus
+#endif // __DECCXX
+
+// Resolves linking problems under HP-UX
+#if defined(__HPUX__) && defined(__GNUG__)
+ #define va_list __gnuc_va_list
+#endif // HP-UX
//////////////////////////////////////////////////////////////////////////////////
// Currently Only MS-Windows/NT, XView and Motif are supported
// Make sure the environment is set correctly
#if defined(__WXMSW__) && defined(__X__)
-# error "Target can't be both X and Windows"
+ #error "Target can't be both X and Windows"
#elif !defined(__WXMOTIF__) && !defined(__WXMSW__) && !defined(__WXGTK__) && \
!defined(__WXMAC__) && !defined(__X__) && !defined(__WXQT__) && !defined(__WXSTUBS__)
-#error "No Target! Use -D[__WXMOTIF__|__WXGTK__|__WXMSW__|__WXMAC__|__WXQT__|__WXSTUBS__]"
+ #error "No Target! Use -D[__WXMOTIF__|__WXGTK__|__WXMSW__|__WXMAC__|__WXQT__|__WXSTUBS__]"
#endif
-#if defined(__WXMOTIF__) || defined(__WXGTK__) || defined(__WXQT__) || defined(__WXSTUBS__)
+// ============================================================================
+// non portable C++ features
+// ============================================================================
-// Bool is now obsolete, use bool instead
-// typedef int Bool;
+// ----------------------------------------------------------------------------
+// check for native bool type and TRUE/FALSE constants
+// ----------------------------------------------------------------------------
-#ifndef TRUE
-# define TRUE 1
-# define FALSE 0
-# define Bool_DEFINED
-#endif
+#if defined(__WXMOTIF__) || defined(__WXGTK__) || defined(__WXQT__) || defined(__WXSTUBS__)
+ // Bool is now obsolete, use bool instead
+ // typedef int Bool;
+ #ifndef TRUE
+ #define TRUE 1
+ #define FALSE 0
+ #define Bool_DEFINED
+ #endif
#elif defined(__WXMSW__)
-
-#ifndef TRUE
-# define TRUE 1
-# define FALSE 0
-#endif
-
-#endif
-
-// VC++ 4.0 is 1000.
-
-// Add more tests here for compilers that don't already define bool.
-#if defined( __MWERKS__ )
- #if (__MWERKS__ < 0x1000) || !__option(bool)
- typedef unsigned int bool;
+ #ifndef TRUE
+ #define TRUE 1
+ #define FALSE 0
#endif
-#elif defined(__SC__)
- typedef unsigned int bool;
-#elif defined(__SALFORDC__)
- typedef unsigned int bool;
-#elif defined(__VISUALC__) && (__VISUALC__ <= 1000)
- typedef unsigned int bool;
-#elif defined(__VISUALC__) && (__VISUALC__ == 1020)
- #define bool unsigned int
-#elif defined(__BORLANDC__) && (__BORLANDC__ < 0x500)
- typedef unsigned int bool;
-#elif defined(__WATCOMC__)
-// typedef unsigned int bool;
-
- #if (__WATCOMC__ < 1100)
+#endif // TRUE/FALSE
+
+// Add more tests here for Windows compilers that already define bool
+// (under Unix, configure tests for this)
+#ifndef HAVE_BOOL
+ #if defined( __MWERKS__ )
+ #if (__MWERKS__ >= 0x1000) && !__option(bool)
+ #define HAVE_BOOL
+ #endif
+ #elif defined(__VISUALC__) && (__VISUALC__ == 1020)
+ // in VC++ 4.2 the bool keyword is reserved (hence can't be typedefed)
+ // but not implemented, so we must #define it
+ #define bool unsigned int
+ #elif defined(__VISUALC__) && (__VISUALC__ > 1020)
+ // VC++ supports bool since 4.2
+ #define HAVE_BOOL
+ #elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x500)
+ // Borland 5.0+ supports bool
+ #define HAVE_BOOL
+ #elif defined(__WATCOMC__) && (__WATCOMC__ >= 1100)
+ // Watcom 11+ supports bool
+ #define HAVE_BOOL
+ #endif // compilers
+#endif // HAVE_BOOL
+
+#if !defined(HAVE_BOOL) && !defined(bool)
+ // NB: of course, this doesn't replace the standard type, because, for
+ // example, overloading based on bool/int parameter doesn't work and
+ // so should be avoided in portable programs
typedef unsigned int bool;
- #endif
-
-#elif defined(__SUNCC__)
- #ifdef __SUNPRO_CC
- // starting from version 5.0 Sun CC understands 'bool'
- #if __SUNPRO_CC <= 0x0420
- // If we use int, we get identically overloaded functions in config.cpp
- typedef unsigned char bool;
- #endif // Sun CC version
- #else
- #error "Unknown compiler: only Sun's CC and gcc are currently recognised."
- #endif // Sun CC
-#endif
-
-#if ( defined(__VISUALC__) && (__VISUALC__ <= 800) ) || defined(__GNUWIN32__) || (defined(__BORLANDC__) && defined(__WIN16__)) || defined(__SC__) || defined(__SALFORDC__)
-// Not a good idea, because later system files (e.g. windows.h)
-// may try to define it. Use wxByte instead.
-// #define byte unsigned char
-#endif
+#endif // bool
typedef unsigned char wxByte;
typedef short int WXTYPE;
// Macro to cut down on compiler warnings.
#if REMOVE_UNUSED_ARG
-#define WXUNUSED(identifier) /* identifier */
+ #define WXUNUSED(identifier) /* identifier */
#else // stupid, broken compiler
-#define WXUNUSED(identifier) identifier
+ #define WXUNUSED(identifier) identifier
#endif
/*
#ifdef __WXMSW__
-/*
-#ifdef __BORLANDC__
-
-# ifdef WXMAKINGDLL
-# define WXDLLEXPORT __export
-# define WXDLLEXPORT_DATA(type) type __export
-# define WXDLLEXPORT_CTORFN __export
-# elif defined(WXUSINGDLL)
-# define WXDLLEXPORT __import
-# define WXDLLEXPORT_DATA(type) type __import
-# define WXDLLEXPORT_CTORFN
-# else
-# define WXDLLEXPORT
-# define WXDLLEXPORT_DATA(type) type
-# define WXDLLEXPORT_CTORFN
-# endif
-
-#else
-*/
-
// _declspec works in BC++ 5 and later, as well as VC++
#if defined(__VISUALC__) || defined(__BORLANDC__)
# define WXDLLEXPORT_CTORFN
#endif
-#else
-// Non-Windows
+#else // !Windows
# define WXDLLEXPORT
# define WXDLLEXPORT_DATA(type) type
# define WXDLLEXPORT_CTORFN
-#endif
+#endif // Win/!Win
// For ostream, istream ofstream
#if defined(__BORLANDC__) && defined( _RTLDLL )
integer on success as failure indicator */
#define wxNOT_FOUND (-1)
-// ----------------------------------------------------------------------------
-// Error codes
-// ----------------------------------------------------------------------------
-
-#ifdef ERR_PARAM
-#undef ERR_PARAM
-#endif
-
-/// Standard error codes
-enum ErrCode
-{
- /// invalid parameter (in broad sense)
- ERR_PARAM = (-4000),
- /// no more data (iteration functions usually return this)
- ERR_NODATA,
- /// user cancelled the operation
- ERR_CANCEL,
- /// no error (the only non negative error code)
- ERR_SUCCESS = 0
-};
-
// ----------------------------------------------------------------------------
/** @name Very common macros */
// ----------------------------------------------------------------------------
* wxTabCtrl flags
*/
-#define wxTAB_MULTILINE 0x0000
-#define wxTAB_RIGHTJUSTIFY 0x0004
-#define wxTAB_FIXEDWIDTH 0x0008
-#define wxTAB_OWNERDRAW 0x0010
-
-// Sorry, I changed my mind about these names...
#define wxTC_MULTILINE 0x0000
#define wxTC_RIGHTJUSTIFY 0x0004
#define wxTC_FIXEDWIDTH 0x0008
#define wxTC_OWNERDRAW 0x0010
+/*
+ * wxNotebook flags
+ */
+#define wxNB_FIXEDWIDTH 0x0008
+
/*
* wxStatusBar95 flags
*/