#include "wx/setup.h"
+// check the consistency of the settings in setup.h
+#include "wx/chkconf.h"
+
// old C++ headers (like <iostream.h>) declare classes in the global namespace
// while the new, standard ones (like <iostream>) do it in std:: namespace
//
// suppress some Watcom C++ warnings
#ifdef __WATCOMC__
-# pragma warning 849 9 // Disable 'virtual function hidden'
-# pragma warning 549 9 // Disable 'operand contains compiler generated information'
+# pragma warning 849 9 // Disable 'virtual function hidden'
+# pragma warning 549 9 // Disable 'operand contains compiler generated information'
#endif // __VISUALC__
// suppress some Salford C++ warnings
#error "Target can't be both X and Windows"
#elif !defined(__WXMOTIF__) && !defined(__WXMSW__) && !defined(__WXGTK__) && \
!defined(__WXPM__) && !defined(__WXMAC__) && !defined(__X__) && \
- !defined(__WXQT__) && !defined(__WXMGL__) && wxUSE_GUI
+ !defined(__WXMGL__) && wxUSE_GUI
#ifdef __UNIX__
#error "No Target! You should use wx-config program for compilation flags!"
#else // !Unix
// because -1 is a valid (and largely used) value for window id.
typedef int wxWindowID;
-// Macro to cut down on compiler warnings.
-#if REMOVE_UNUSED_ARG
- #define WXUNUSED(identifier) /* identifier */
-#else // stupid, broken compiler
- #define WXUNUSED(identifier) identifier
-#endif
-
-// some arguments are only used in debug mode, but unused in release one
-#ifdef __WXDEBUG__
- #define WXUNUSED_UNLESS_DEBUG(param) param
-#else
- #define WXUNUSED_UNLESS_DEBUG(param) WXUNUSED(param)
-#endif
-
// ----------------------------------------------------------------------------
// portable calling conventions macros
// ----------------------------------------------------------------------------
#elif defined(__WXPM__)
-# if (!(defined(__VISAGECPP__) && (__IBMCPP__ < 400 || __IBMC__ < 400 )))
+# if defined (__WATCOMC__)
+
+# ifdef WXMAKINGDLL
+# define WXDLLEXPORT __declspec( dllexport )
+# define WXDLLEXPORT_DATA(type) __declspec( dllexport ) type
+# define WXDLLEXPORT_CTORFN
+// __declspec(dllimport) prepends __imp to imported symbols. We do NOT want that!
+//# elif defined(WXUSINGDLL)
+//# define WXDLLEXPORT __declspec( dllimport )
+//# define WXDLLEXPORT_DATA(type) __declspec( dllimport ) type
+//# define WXDLLEXPORT_CTORFN
+# else
+# define WXDLLEXPORT
+# define WXDLLEXPORT_DATA(type) type
+# define WXDLLEXPORT_CTORFN
+# endif
+
+# elif (!(defined(__VISAGECPP__) && (__IBMCPP__ < 400 || __IBMC__ < 400 )))
# ifdef WXMAKINGDLL
# define WXDLLEXPORT _Export
class WXDLLEXPORT wxEvent;
#endif
- /** symbolic constant used by all Find()-like functions returning positive
- integer on success as failure indicator */
+// symbolic constant used by all Find()-like functions returning positive
+// integer on success as failure indicator
#define wxNOT_FOUND (-1)
// ----------------------------------------------------------------------------
#include "wx/debug.h"
#endif
-// NULL declaration
+// NULL declaration: it must be defined as 0 for C++ programs (in particular,
+// it must not be defined as "(void *)0" which is standard for C but completely
+// breaks C++ code)
#include <stddef.h>
-//@{
-/// delete pointer if it is not NULL and NULL it afterwards
+// Macro to cut down on compiler warnings.
+#if REMOVE_UNUSED_ARG
+ #define WXUNUSED(identifier) /* identifier */
+#else // stupid, broken compiler
+ #define WXUNUSED(identifier) identifier
+#endif
+
+// some arguments are only used in debug mode, but unused in release one
+#ifdef __WXDEBUG__
+ #define WXUNUSED_UNLESS_DEBUG(param) param
+#else
+ #define WXUNUSED_UNLESS_DEBUG(param) WXUNUSED(param)
+#endif
+
+// delete pointer if it is not NULL and NULL it afterwards
// (checking that it's !NULL before passing it to delete is just a
// a question of style, because delete will do it itself anyhow, but it might
// be considered as an error by some overzealous debugging implementations of
// the library, so we do it ourselves)
-#if defined(__SGI_CC__)
-// Okay this is bad styling, but the native SGI compiler is very picky, it
-// wont let you compare/assign between a NULL (void *) and another pointer
-// type. To be really clean we'd need to pass in another argument, the type
-// of p.
-// Also note the use of 0L, this would allow future possible 64bit support
-// (as yet untested) by ensuring that we zero all the bits in a pointer
-// (which is always the same length as a long (at least with the LP64 standard)
-// --- offer aug 98
-#define wxDELETE(p) if ( (p) ) { delete (p); p = 0L; }
-#else
#define wxDELETE(p) if ( (p) != NULL ) { delete p; p = NULL; }
-#endif /* __SGI__CC__ */
// delete an array and NULL it (see comments above)
-#if defined(__SGI_CC__)
-// see above comment.
-#define wxDELETEA(p) if ( (p) ) { delete [] (p); p = 0L; }
-#else
-#define wxDELETEA(p) if ( ((void *) (p)) != NULL ) { delete [] p; p = NULL; }
-#endif /* __SGI__CC__ */
+#define wxDELETEA(p) if ( (p) ) { delete [] (p); p = NULL; }
-/// size of statically declared array
+// size of statically declared array
#define WXSIZEOF(array) (sizeof(array)/sizeof(array[0]))
// ----------------------------------------------------------------------------
wxGTK_WIN32, // GTK on Win32
wxGTK_OS2, // GTK on OS/2
wxGTK_BEOS, // GTK on BeOS
- wxQT, // Qt
wxGEOS, // GEOS
wxOS2_PM, // OS/2 Workplace
wxWINDOWS, // Windows or WfW
// descend into all subwindows
#define wxWS_EX_VALIDATE_RECURSIVELY 0x00000001
+// wxCommandEvents and the objects of the derived classes are forwarded to the
+// parent window and so on recursively by default. Using this flag for the
+// given window allows to block this propagation at this window, i.e. prevent
+// the events from being propagated further upwards. The dialogs have this
+// flag on by default.
+#define wxWS_EX_BLOCK_EVENTS 0x00000002
+
/*
* wxFrame/wxDialog style flags
*/
// WIN32 graphics types for OS/2 GPI
// RGB under OS2 is more like a PALETTEENTRY struct under Windows so we need a real RGB def
-#define OS2RGB(r,g,b) ((DWORD ((BYTE) (b) | ((WORD) (g) << 8)) | (((DWORD)(BYTE)(r)) << 16)))
+// WARNING: The OS/2 headers typedef BYTE simply as 'char'; if the default is signed, all
+// hell will break loose!
+//#define OS2RGB(r,g,b) ((DWORD ((BYTE) (b) | ((WORD) (g) << 8)) | (((DWORD)(BYTE)(r)) << 16)))
+#define OS2RGB(r,g,b) ((DWORD)((unsigned char)(b) | ((unsigned char)(g) << 8)) | ((unsigned char)(r) << 16))
typedef unsigned long COLORREF;
#define GetBValue(rgb) ((BYTE)((rgb) >> 16))
#elif defined(__WIN32__)
typedef int (__stdcall *WXFARPROC)();
#elif defined(__WXPM__)
-# if defined(__VISAGECPP__) && (__IBMCPP__ < 400 || __IBMC__ < 400 )
+# if (defined(__VISAGECPP__) && (__IBMCPP__ < 400 || __IBMC__ < 400 )) || defined (__WATCOMC__)
// VA 3.0 for some reason needs base data types when typedefing a proc proto???
typedef void* (_System *WXFARPROC)(unsigned long, unsigned long, void*, void*);
# else
#endif // GTK
#ifdef __WXMGL__
-typedef void *WXWidget; // FIXME_MGL - type-safe
+typedef struct window_t *WXWidget;
#endif // MGL
// This is required because of clashing macros in windows.h, which may be