From 65fd5cb0124e62ab1fc41f93382a205d95b00e75 Mon Sep 17 00:00:00 2001 From: "J. Russell Smyth" Date: Wed, 4 Aug 1999 00:42:51 +0000 Subject: [PATCH] Made changes to allow build with new mingw32/gcc-2.95 added wxUSE_NORLANDER_HEADERS for mingw32/gcc-2.95 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3258 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/defs.h | 8 ++++++++ include/wx/msw/private.h | 4 ++-- include/wx/msw/registry.h | 2 +- src/common/dynlib.cpp | 2 +- src/generic/tipdlg.cpp | 2 +- src/msw/app.cpp | 2 +- src/msw/checklst.cpp | 2 +- src/msw/control.cpp | 2 +- src/msw/curico.cpp | 2 +- src/msw/dc.cpp | 3 +++ src/msw/dde.cpp | 2 ++ src/msw/dib.cpp | 2 ++ src/msw/dibutils.cpp | 2 +- src/msw/dragimag.cpp | 2 +- src/msw/gauge95.cpp | 2 +- src/msw/imaglist.cpp | 2 +- src/msw/joystick.cpp | 4 +++- src/msw/listbox.cpp | 4 +++- src/msw/listctrl.cpp | 2 +- src/msw/minifram.cpp | 2 ++ src/msw/notebook.cpp | 4 +++- src/msw/registry.cpp | 2 +- src/msw/slider95.cpp | 2 +- src/msw/spinbutt.cpp | 2 +- src/msw/statbr95.cpp | 2 +- src/msw/tabctrl.cpp | 4 +++- src/msw/taskbar.cpp | 2 ++ src/msw/tbar95.cpp | 4 +++- src/msw/textctrl.cpp | 2 +- src/msw/tooltip.cpp | 4 ++-- src/msw/treectrl.cpp | 6 ++++-- src/msw/wave.cpp | 4 +++- src/msw/window.cpp | 8 +++++--- utils/wxtree/src/makefile.g95 | 2 +- 34 files changed, 68 insertions(+), 33 deletions(-) diff --git a/include/wx/defs.h b/include/wx/defs.h index 5e225385ec..f99ef2326b 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -129,6 +129,14 @@ #if defined(__HPUX__) && defined(__GNUG__) #define va_list __gnuc_va_list #endif // HP-UX + +// Mingw32 gcc-2.95 uses new windows headers which are more ms-like +// we are setting this define because of the complex check +// using NORLANDER as Cygwin may follow. (header author is Anders Norlander) +#if defined(__MINGW32__) && (__GNUC__>=2) && (__GNUC_MINOR__>=95) +# define wxUSE_NORLANDER_HEADERS 1 +#endif + ////////////////////////////////////////////////////////////////////////////////// // Currently Only MS-Windows/NT, XView and Motif are supported diff --git a/include/wx/msw/private.h b/include/wx/msw/private.h index 8d4eee417e..0ff6b1a46d 100644 --- a/include/wx/msw/private.h +++ b/include/wx/msw/private.h @@ -56,7 +56,7 @@ WXDLLEXPORT_DATA(extern HFONT) wxSTATUS_LINE_FONT; // window proc // --------------------------------------------------------------------------- -#if defined(__GNUWIN32__) +#if defined(__GNUWIN32__) && !defined(wxUSE_NORLANDER_HEADERS) # define CASTWNDPROC (long unsigned) #else # ifdef __BORLANDC__ @@ -69,7 +69,7 @@ WXDLLEXPORT_DATA(extern HFONT) wxSTATUS_LINE_FONT; # endif # else -# if defined (__WIN32__) && defined(STRICT) +# if defined (__WIN32__) && defined(STRICT) typedef long (_stdcall * WndProcCast) (HWND, unsigned int, unsigned int, long); # define CASTWNDPROC (WndProcCast) # elif defined(__WIN16__) diff --git a/include/wx/msw/registry.h b/include/wx/msw/registry.h index 693207b3fd..958b78c878 100644 --- a/include/wx/msw/registry.h +++ b/include/wx/msw/registry.h @@ -125,7 +125,7 @@ public: bool Exists() const; // get the info about key (any number of these pointers may be NULL) -#ifdef __GNUWIN32__ +#if defined( __GNUWIN32__) && !defined(wxUSE_NORLANDER_HEADERS) bool GetKeyInfo(size_t *pnSubKeys, // number of subkeys size_t *pnMaxKeyLen, // max len of subkey name size_t *pnValues, // number of values diff --git a/src/common/dynlib.cpp b/src/common/dynlib.cpp index ef1ba88aa1..a3158210e2 100644 --- a/src/common/dynlib.cpp +++ b/src/common/dynlib.cpp @@ -276,7 +276,7 @@ wxDllLoader::GetSymbol(wxDllType dllHandle, const wxString &name) // wxLibraries (only one instance should normally exist) // --------------------------------------------------------------------------- -wxLibraries::wxLibraries() +wxLibraries::wxLibraries():m_loaded(wxKEY_STRING) { } diff --git a/src/generic/tipdlg.cpp b/src/generic/tipdlg.cpp index ad93ae8f81..4aebcf06e3 100644 --- a/src/generic/tipdlg.cpp +++ b/src/generic/tipdlg.cpp @@ -152,7 +152,7 @@ wxString wxFileTipProvider::GetTip() // ---------------------------------------------------------------------------- BEGIN_EVENT_TABLE(wxTipDialog, wxDialog) - EVT_BUTTON(wxID_NEXT_TIP, OnNextTip) + EVT_BUTTON(wxID_NEXT_TIP, wxTipDialog::OnNextTip) END_EVENT_TABLE() wxTipDialog::wxTipDialog(wxWindow *parent, diff --git a/src/msw/app.cpp b/src/msw/app.cpp index 35c8510c48..dc4e711541 100644 --- a/src/msw/app.cpp +++ b/src/msw/app.cpp @@ -82,7 +82,7 @@ #include #include -#if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__) +#if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__) || defined(wxUSE_NORLANDER_HEADERS) #include #endif diff --git a/src/msw/checklst.cpp b/src/msw/checklst.cpp index f9de4075a8..963c661c43 100644 --- a/src/msw/checklst.cpp +++ b/src/msw/checklst.cpp @@ -45,7 +45,7 @@ #include #include -#ifdef __GNUWIN32__ +#if defined(__GNUWIN32__) && !defined(wxUSE_NORLANDER_HEADERS) #include "wx/msw/gnuwin32/extra.h" #endif diff --git a/src/msw/control.cpp b/src/msw/control.cpp index 88ab79da90..3ae9f711d2 100644 --- a/src/msw/control.cpp +++ b/src/msw/control.cpp @@ -30,7 +30,7 @@ #include "wx/msw/private.h" -#if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__) +#if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__) || defined(wxUSE_NORLANDER_HEADERS) #include #endif diff --git a/src/msw/curico.cpp b/src/msw/curico.cpp index 7cabfd7ce0..5bd16e67a0 100644 --- a/src/msw/curico.cpp +++ b/src/msw/curico.cpp @@ -25,7 +25,7 @@ #endif #ifndef __TWIN32__ -#ifdef __GNUWIN32__ +#if defined (__GNUWIN32__) && !defined(wxUSE_NORLANDER_HEADERS) #include "wx/msw/gnuwin32/extra.h" #endif #endif diff --git a/src/msw/dc.cpp b/src/msw/dc.cpp index d17e9b1961..f424405768 100644 --- a/src/msw/dc.cpp +++ b/src/msw/dc.cpp @@ -46,6 +46,9 @@ #include #if wxUSE_COMMON_DIALOGS +#if wxUSE_NORLANDER_HEADERS + #include +#endif #include #endif diff --git a/src/msw/dde.cpp b/src/msw/dde.cpp index 2d28519ecc..cff1fb1a1a 100644 --- a/src/msw/dde.cpp +++ b/src/msw/dde.cpp @@ -39,10 +39,12 @@ #include #ifndef __TWIN32__ +#if !wxUSE_NORLANDER_HEADERS #ifdef __GNUWIN32__ #include "wx/msw/gnuwin32/extra.h" #endif #endif +#endif #include diff --git a/src/msw/dib.cpp b/src/msw/dib.cpp index 54ccf8ab88..e4f8360ad6 100644 --- a/src/msw/dib.cpp +++ b/src/msw/dib.cpp @@ -49,10 +49,12 @@ #include "wx/msw/dib.h" #ifndef __TWIN32__ +#ifndef wxUSE_NORLANDER_HEADERS #ifdef __GNUWIN32__ #include "wx/msw/gnuwin32/extra.h" #endif #endif +#endif #ifndef SEEK_CUR /* flags for _lseek */ diff --git a/src/msw/dibutils.cpp b/src/msw/dibutils.cpp index e8f639f22c..31bcfb7e29 100644 --- a/src/msw/dibutils.cpp +++ b/src/msw/dibutils.cpp @@ -167,7 +167,7 @@ int DibWriteFile(LPTSTR szFile, LPBITMAPINFOHEADER lpbi) bmf.bfReserved1 = 0; bmf.bfReserved2 = 0; bmf.bfOffBits = sizeof(bmf) + (char FAR*)(DibPtr(lpbi)) - (char FAR*)lpbi; -#if defined( __WATCOMC__) || defined(__VISUALC__) || defined(__SC__) || defined(__SALFORDC__) || defined(__MWERKS__) +#if defined( __WATCOMC__) || defined(__VISUALC__) || defined(__SC__) || defined(__SALFORDC__) || defined(__MWERKS__) || defined(wxUSE_NORLANDER_HEADERS) if (_hwrite(fh, (LPCSTR)(&bmf), sizeof(bmf))<0 || _hwrite(fh, (LPCSTR)lpbi, size)<0) { _lclose(fh); diff --git a/src/msw/dragimag.cpp b/src/msw/dragimag.cpp index 8c6749eb92..667462e346 100644 --- a/src/msw/dragimag.cpp +++ b/src/msw/dragimag.cpp @@ -38,7 +38,7 @@ #include "wx/msw/dragimag.h" #include "wx/msw/private.h" -#if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__) +#if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__) || defined(wxUSE_NORLANDER_HEADERS) #include #endif diff --git a/src/msw/gauge95.cpp b/src/msw/gauge95.cpp index ade3fdca7c..0ddfcba4d4 100644 --- a/src/msw/gauge95.cpp +++ b/src/msw/gauge95.cpp @@ -29,7 +29,7 @@ #include "wx/msw/gauge95.h" #include "wx/msw/private.h" -#if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__) +#if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__) || defined(wxUSE_NORLANDER_HEADERS) #include #endif diff --git a/src/msw/imaglist.cpp b/src/msw/imaglist.cpp index a4e2fe629d..540c176058 100644 --- a/src/msw/imaglist.cpp +++ b/src/msw/imaglist.cpp @@ -37,7 +37,7 @@ #include "wx/msw/imaglist.h" #include "wx/msw/private.h" -#if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__) +#if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__) || defined(wxUSE_NORLANDER_HEADERS) #include #endif diff --git a/src/msw/joystick.cpp b/src/msw/joystick.cpp index 407e704130..58b7631915 100644 --- a/src/msw/joystick.cpp +++ b/src/msw/joystick.cpp @@ -24,7 +24,7 @@ #include "wx/window.h" #include "wx/msw/private.h" -#ifndef __GNUWIN32__ +#if !defined( __GNUWIN32__ ) || defined(wxUSE_NORLANDER_HEADERS) #include #endif @@ -34,9 +34,11 @@ typedef UINT MMRESULT; #ifndef __TWIN32__ #ifdef __GNUWIN32__ +#ifndef wxUSE_NORLANDER_HEADERS #include #endif #endif +#endif // Why doesn't BC++ have joyGetPosEx? #if !defined(__WIN32__) || defined(__BORLANDC__) || defined(__TWIN32__) diff --git a/src/msw/listbox.cpp b/src/msw/listbox.cpp index 34927877b2..02d55e900d 100644 --- a/src/msw/listbox.cpp +++ b/src/msw/listbox.cpp @@ -49,7 +49,9 @@ #ifndef __TWIN32__ #if defined(__GNUWIN32__) - #include + #ifndef wxUSE_NORLANDER_HEADERS + #include + #endif #endif #endif diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index 811fadec21..e3372ec707 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -39,7 +39,7 @@ #include "wx/msw/private.h" -#ifdef __GNUWIN32__ +#if defined(__GNUWIN32__) && !defined(wxUSE_NORLANDER_HEADERS) #include "wx/msw/gnuwin32/extra.h" #else #include diff --git a/src/msw/minifram.cpp b/src/msw/minifram.cpp index 016e7e775a..e40b0532f8 100644 --- a/src/msw/minifram.cpp +++ b/src/msw/minifram.cpp @@ -36,9 +36,11 @@ #ifndef __TWIN32__ #ifdef __GNUWIN32__ +#ifndef wxUSE_NORLANDER_HEADERS #include "wx/msw/gnuwin32/extra.h" #endif #endif +#endif #if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxMiniFrame, wxFrame) diff --git a/src/msw/notebook.cpp b/src/msw/notebook.cpp index 52bf8dcd0d..2961439e4b 100644 --- a/src/msw/notebook.cpp +++ b/src/msw/notebook.cpp @@ -42,11 +42,13 @@ #ifndef __TWIN32__ #ifdef __GNUWIN32__ +#ifndef wxUSE_NORLANDER_HEADERS #include "wx/msw/gnuwin32/extra.h" #endif #endif +#endif -#if !defined(__GNUWIN32__) || defined(__TWIN32__) +#if !defined(__GNUWIN32__) || defined(__TWIN32__) || defined(wxUSE_NORLANDER_HEADERS) #include #endif diff --git a/src/msw/registry.cpp b/src/msw/registry.cpp index dca9790b5d..fe8897463e 100644 --- a/src/msw/registry.cpp +++ b/src/msw/registry.cpp @@ -302,7 +302,7 @@ wxString wxRegKey::GetName(bool bShortPrefix) const return str; } -#ifdef __GNUWIN32__ +#if defined( __GNUWIN32__ ) && !defined(wxUSE_NORLANDER_HEADERS) bool wxRegKey::GetKeyInfo(size_t* pnSubKeys, size_t* pnMaxKeyLen, size_t* pnValues, diff --git a/src/msw/slider95.cpp b/src/msw/slider95.cpp index ad622b84fd..d6334217be 100644 --- a/src/msw/slider95.cpp +++ b/src/msw/slider95.cpp @@ -31,7 +31,7 @@ #include "wx/msw/slider95.h" #include "wx/msw/private.h" -#if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__) +#if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__) || defined(wxUSE_NORLANDER_HEADERS) #include #endif diff --git a/src/msw/spinbutt.cpp b/src/msw/spinbutt.cpp index 86e07a7f84..b83b6f0493 100644 --- a/src/msw/spinbutt.cpp +++ b/src/msw/spinbutt.cpp @@ -32,7 +32,7 @@ #include "wx/spinbutt.h" #include "wx/msw/private.h" -#if !defined(__GNUWIN32__) || defined(__TWIN32__) +#if !defined(__GNUWIN32__) || defined(__TWIN32__) || defined(wxUSE_NORLANDER_HEADERS) #include #endif diff --git a/src/msw/statbr95.cpp b/src/msw/statbr95.cpp index e6a2d6dbdb..b8de79f67c 100644 --- a/src/msw/statbr95.cpp +++ b/src/msw/statbr95.cpp @@ -36,7 +36,7 @@ #include "wx/msw/private.h" #include -#if !defined(__GNUWIN32__) || defined(__TWIN32__) +#if !defined(__GNUWIN32__) || defined(__TWIN32__) || defined(wxUSE_NORLANDER_HEADERS) #include #endif diff --git a/src/msw/tabctrl.cpp b/src/msw/tabctrl.cpp index 4f525436fc..ee06ee6fe4 100644 --- a/src/msw/tabctrl.cpp +++ b/src/msw/tabctrl.cpp @@ -32,15 +32,17 @@ #include -#if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__) +#if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__) || defined(wxUSE_NORLANDER_HEADERS) #include #endif #ifndef __TWIN32__ #ifdef __GNUWIN32__ +#ifndef wxUSE_NORLANDER_HEADERS #include "wx/msw/gnuwin32/extra.h" #endif #endif +#endif #include "wx/msw/dib.h" #include "wx/msw/tabctrl.h" diff --git a/src/msw/taskbar.cpp b/src/msw/taskbar.cpp index fdf563dc37..8c8fbe0b6f 100644 --- a/src/msw/taskbar.cpp +++ b/src/msw/taskbar.cpp @@ -37,9 +37,11 @@ #ifndef __TWIN32__ #ifdef __GNUWIN32__ +#ifndef wxUSE_NORLANDER_HEADERS #include #endif #endif +#endif #ifdef __SALFORDC__ #include diff --git a/src/msw/tbar95.cpp b/src/msw/tbar95.cpp index 6a9fcc6cfa..51c70e7556 100644 --- a/src/msw/tbar95.cpp +++ b/src/msw/tbar95.cpp @@ -32,15 +32,17 @@ #include -#if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__) +#if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__) || defined(wxUSE_NORLANDER_HEADERS) #include #endif #ifndef __TWIN32__ #ifdef __GNUWIN32__ +#ifndef wxUSE_NORLANDER_HEADERS #include "wx/msw/gnuwin32/extra.h" #endif #endif +#endif #include "wx/msw/dib.h" #include "wx/tbar95.h" diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index e953ec4e7d..6770cc598c 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -57,7 +57,7 @@ # include #endif -#if wxUSE_RICHEDIT && !defined(__GNUWIN32__) +#if wxUSE_RICHEDIT && (!defined(__GNUWIN32__) || defined(wxUSE_NORLANDER_HEADERS)) #include #endif diff --git a/src/msw/tooltip.cpp b/src/msw/tooltip.cpp index c119026190..ca76d82573 100644 --- a/src/msw/tooltip.cpp +++ b/src/msw/tooltip.cpp @@ -32,7 +32,7 @@ #include "wx/tooltip.h" #include "wx/msw/private.h" -#if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__) +#if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__) || defined(wxUSE_NORLANDER_HEADERS) #include #endif @@ -47,7 +47,7 @@ public: wxToolInfo(wxWindow *win) { // initialize all members -#ifdef __GNUWIN32__ +#if defined( __GNUWIN32__ ) && !defined(wxUSE_NORLANDER_HEADERS) memset(this, 0, sizeof(TOOLINFO)); #else ::ZeroMemory(this, sizeof(TOOLINFO)); diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index 4118355c1a..8363d6ca9f 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -47,10 +47,12 @@ #include "wx/treectrl.h" #ifdef __GNUWIN32__ +#ifndef wxUSE_NORLANDER_HEADERS #include "wx/msw/gnuwin32/extra.h" #endif +#endif -#if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__) +#if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__) || defined(wxUSE_NORLANDER_HEADERS) #include #endif @@ -195,7 +197,7 @@ bool wxTreeCtrl::Create(wxWindow *parent, if ( m_windowStyle & wxTR_LINES_AT_ROOT ) wstyle |= TVS_LINESATROOT; -#ifndef __GNUWIN32__ +#if !defined( __GNUWIN32__ ) && !defined(wxUSE_NORLANDER_HEADERS) // we emulate the multiple selection tree controls by using checkboxes: set // up the image list we need for this if we do have multiple selections if ( m_windowStyle & wxTR_MULTIPLE ) diff --git a/src/msw/wave.cpp b/src/msw/wave.cpp index df4b95ee74..19b164f5a0 100644 --- a/src/msw/wave.cpp +++ b/src/msw/wave.cpp @@ -31,15 +31,17 @@ #include #include -#ifndef __GNUWIN32__ +#if !defined( __GNUWIN32__ ) || defined(wxUSE_NORLANDER_HEADERS) #include #endif #ifndef __TWIN32__ #ifdef __GNUWIN32__ +#ifndef wxUSE_NORLANDER_HEADERS #include "wx/msw/gnuwin32/extra.h" #endif #endif +#endif wxWave::wxWave() : m_waveData(NULL), m_waveLength(0), m_isResource(FALSE) diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 5e17c7e732..b9dfdd75e1 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -80,7 +80,7 @@ #include -#ifndef __GNUWIN32__ +#if !defined(__GNUWIN32__)|| defined(wxUSE_NORLANDER_HEADERS) #include #include #endif @@ -89,13 +89,15 @@ #include #endif -#if ( defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__ ) +#if ( defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__ ) || defined(wxUSE_NORLANDER_HEADERS) #include #endif #ifndef __TWIN32__ #ifdef __GNUWIN32__ - #include + #ifndef wxUSE_NORLANDER_HEADERS + #include + #endif #endif #endif diff --git a/utils/wxtree/src/makefile.g95 b/utils/wxtree/src/makefile.g95 index 38c05afa70..721817437c 100644 --- a/utils/wxtree/src/makefile.g95 +++ b/utils/wxtree/src/makefile.g95 @@ -7,7 +7,7 @@ # # Makefile for wxWindows sample (Cygwin/Mingw32). -WXDIR = ../../.. +WXDIR = $(WXWIN) TARGET=test OBJECTS = $(TARGET).o wxtree.o -- 2.45.2