From 2ecf902bc836f2808444b34eff48cdb12f289460 Mon Sep 17 00:00:00 2001
From: =?utf8?q?W=C5=82odzimierz=20Skiba?= <abx@abx.art.pl>
Date: Wed, 16 Mar 2005 16:18:31 +0000
Subject: [PATCH] Use defs.h (and automatically setup.h and chkconf.h) before
 first wxUSE_* check (bug #1164141).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32852 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---
 include/wx/choice.h    |  2 ++
 include/wx/config.h    | 12 ++++++++++++
 include/wx/ctrlsub.h   |  2 ++
 include/wx/db.h        |  4 ----
 include/wx/dbtable.h   |  2 +-
 include/wx/dynlib.h    |  2 +-
 include/wx/file.h      |  6 ++++--
 include/wx/filedlg.h   |  4 +++-
 include/wx/filesys.h   |  2 +-
 include/wx/gdicmn.h    |  2 +-
 include/wx/gifdecod.h  |  2 +-
 include/wx/gsocket.h   |  3 +--
 include/wx/help.h      | 13 +++++++++++++
 include/wx/image.h     |  8 ++++----
 include/wx/imagjpeg.h  |  9 ++++++---
 include/wx/imagpng.h   |  7 +++++--
 include/wx/imagtiff.h  | 18 ++++++++++--------
 include/wx/joystick.h  | 13 +++++++++++++
 include/wx/listbase.h  |  2 ++
 include/wx/mdi.h       | 13 ++++++++++++-
 include/wx/mediactrl.h |  7 +++++--
 include/wx/menuitem.h  |  2 ++
 include/wx/msgdlg.h    |  2 +-
 include/wx/mstream.h   |  4 +++-
 include/wx/ownerdrw.h  |  2 ++
 include/wx/popupwin.h  |  7 +++++--
 include/wx/radiobut.h  |  2 ++
 include/wx/scrolbar.h  | 13 +++++++++++++
 include/wx/spinctrl.h  |  7 ++++++-
 include/wx/statbox.h   | 13 +++++++++++++
 include/wx/stattext.h  | 13 +++++++++++++
 include/wx/stopwatch.h |  1 +
 include/wx/timer.h     |  8 ++++----
 include/wx/tooltip.h   | 13 ++++++++++++-
 include/wx/treebase.h  |  2 ++
 include/wx/wave.h      |  2 +-
 include/wx/wizard.h    |  2 ++
 include/wx/xpmdecod.h  |  2 +-
 src/common/socket.cpp  |  1 +
 39 files changed, 183 insertions(+), 46 deletions(-)

diff --git a/include/wx/choice.h b/include/wx/choice.h
index 9f396fdd9c..ea08445c75 100644
--- a/include/wx/choice.h
+++ b/include/wx/choice.h
@@ -20,6 +20,8 @@
     #pragma interface "choicebase.h"
 #endif
 
+#include "wx/defs.h"
+
 #if wxUSE_CHOICE
 
 #include "wx/ctrlsub.h"     // the base class
diff --git a/include/wx/config.h b/include/wx/config.h
index e6275cb52e..2028c217ae 100644
--- a/include/wx/config.h
+++ b/include/wx/config.h
@@ -1,6 +1,18 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        config.h
+// Purpose:     wxConfig base header
+// Author:      wxWidgets Team
+// Modified by:
+// Created:
+// Copyright:   (c) wxWidgets Team
+// RCS-ID:      $Id$
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
 #ifndef _WX_CONFIG_H_BASE_
 #define _WX_CONFIG_H_BASE_
 
+#include "wx/defs.h"
 #include "wx/confbase.h"
 
 #if defined(__WXMSW__) && wxUSE_CONFIG_NATIVE
diff --git a/include/wx/ctrlsub.h b/include/wx/ctrlsub.h
index c7cddfe660..d747a60d2b 100644
--- a/include/wx/ctrlsub.h
+++ b/include/wx/ctrlsub.h
@@ -16,6 +16,8 @@
     #pragma interface "controlwithitems.h"
 #endif
 
+#include "wx/defs.h"
+
 #if wxUSE_CONTROLS
 
 #include "wx/control.h"      // base class
diff --git a/include/wx/db.h b/include/wx/db.h
index 8c05a2aae3..63ab1a66c7 100644
--- a/include/wx/db.h
+++ b/include/wx/db.h
@@ -31,14 +31,10 @@
 #define OLD_GETCOLUMNS 1
 #define EXPERIMENTAL_WXDB_FUNCTIONS 1
 
-#include "wx/version.h"
-
 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma interface "db.h"
 #endif
 
-#include "wx/setup.h"
-
 #include "wx/defs.h"
 #include "wx/string.h"
 
diff --git a/include/wx/dbtable.h b/include/wx/dbtable.h
index 463c1f3caf..45970a6a1b 100644
--- a/include/wx/dbtable.h
+++ b/include/wx/dbtable.h
@@ -19,7 +19,7 @@
 #ifndef DBTABLE_DOT_H
 #define DBTABLE_DOT_H
 
-#include "wx/version.h"
+#include "wx/defs.h"
 
 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
   #pragma interface "dbtable.h"
diff --git a/include/wx/dynlib.h b/include/wx/dynlib.h
index 4eeaffef92..8bcc8b4d35 100644
--- a/include/wx/dynlib.h
+++ b/include/wx/dynlib.h
@@ -16,7 +16,7 @@
 #   pragma interface "dynlib.h"
 #endif
 
-#include "wx/setup.h"
+#include "wx/defs.h"
 
 #if wxUSE_DYNLIB_CLASS
 
diff --git a/include/wx/file.h b/include/wx/file.h
index abb427af66..35b7aeb502 100644
--- a/include/wx/file.h
+++ b/include/wx/file.h
@@ -17,12 +17,14 @@
 #pragma interface "file.h"
 #endif
 
+#include  "wx/defs.h"
+
+#if wxUSE_FILE
+
 #include  "wx/string.h"
 #include  "wx/filefn.h"
 #include  "wx/strconv.h"
 
-#if wxUSE_FILE
-
 // ----------------------------------------------------------------------------
 // constants
 // ----------------------------------------------------------------------------
diff --git a/include/wx/filedlg.h b/include/wx/filedlg.h
index 52d5aeb6d0..60c59e80ef 100644
--- a/include/wx/filedlg.h
+++ b/include/wx/filedlg.h
@@ -5,13 +5,15 @@
 // Modified by:
 // Created:     8/17/99
 // Copyright:   (c) Robert Roebling
-// RCS-ID:
+// RCS-ID:      $Id$
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 #ifndef _WX_FILEDLG_H_BASE_
 #define _WX_FILEDLG_H_BASE_
 
+#include "wx/defs.h"
+
 #if wxUSE_FILEDLG
 
 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
diff --git a/include/wx/filesys.h b/include/wx/filesys.h
index 46f267cf47..a75350f724 100644
--- a/include/wx/filesys.h
+++ b/include/wx/filesys.h
@@ -14,7 +14,7 @@
 #pragma interface "filesys.h"
 #endif
 
-#include "wx/setup.h"
+#include "wx/defs.h"
 
 #if !wxUSE_STREAMS
 #error You cannot compile virtual file systems without wxUSE_STREAMS
diff --git a/include/wx/gdicmn.h b/include/wx/gdicmn.h
index 968feded88..aa7d92113d 100644
--- a/include/wx/gdicmn.h
+++ b/include/wx/gdicmn.h
@@ -20,7 +20,7 @@
     #pragma interface "gdicmn.h"
 #endif
 
-#include "wx/setup.h"
+#include "wx/defs.h"
 #include "wx/list.h"
 #include "wx/string.h"
 #include "wx/fontenc.h"
diff --git a/include/wx/gifdecod.h b/include/wx/gifdecod.h
index 3545fc288f..f61739ed7e 100644
--- a/include/wx/gifdecod.h
+++ b/include/wx/gifdecod.h
@@ -15,7 +15,7 @@
 #pragma interface "gifdecod.h"
 #endif
 
-#include "wx/setup.h"
+#include "wx/defs.h"
 
 #if wxUSE_STREAMS && wxUSE_GIF
 
diff --git a/include/wx/gsocket.h b/include/wx/gsocket.h
index 9ace677b54..009804091e 100644
--- a/include/wx/gsocket.h
+++ b/include/wx/gsocket.h
@@ -12,8 +12,7 @@
 #define __GSOCKET_H
 
 #ifndef __GSOCKET_STANDALONE__
-#include "wx/setup.h"
-#include "wx/platform.h"
+#include "wx/defs.h"
 
 #include "wx/dlimpexp.h" /* for WXDLLIMPEXP_NET */
 
diff --git a/include/wx/help.h b/include/wx/help.h
index 5ea82acabd..267a4b4d13 100644
--- a/include/wx/help.h
+++ b/include/wx/help.h
@@ -1,6 +1,19 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        help.h
+// Purpose:     wxHelpController base header
+// Author:      wxWidgets Team
+// Modified by:
+// Created:
+// Copyright:   (c) wxWidgets Team
+// RCS-ID:      $Id$
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
 #ifndef _WX_HELP_H_BASE_
 #define _WX_HELP_H_BASE_
 
+#include "wx/defs.h"
+
 #if wxUSE_HELP
 
 #include "wx/helpbase.h"
diff --git a/include/wx/image.h b/include/wx/image.h
index 61f54d16cf..665d89534e 100644
--- a/include/wx/image.h
+++ b/include/wx/image.h
@@ -14,7 +14,7 @@
 #pragma interface "image.h"
 #endif
 
-#include "wx/setup.h"
+#include "wx/defs.h"
 #include "wx/object.h"
 #include "wx/string.h"
 #include "wx/gdicmn.h"
@@ -182,9 +182,9 @@ public:
 
     // Paste the image or part of this image into an image of the given size at the pos
     //  any newly exposed areas will be filled with the rgb colour
-    //  by default if r = g = b = -1 then fill with this image's mask colour or find and 
+    //  by default if r = g = b = -1 then fill with this image's mask colour or find and
     //  set a suitable mask colour
-    wxImage Size( const wxSize& size, const wxPoint& pos, 
+    wxImage Size( const wxSize& size, const wxPoint& pos,
                   int r = -1, int g = -1, int b = -1 ) const;
 
     // pastes image into this instance and takes care of
@@ -200,7 +200,7 @@ public:
     wxImage& Rescale( int width, int height ) { return *this = Scale(width, height); }
 
     // resizes the image in place
-    wxImage& Resize( const wxSize& size, const wxPoint& pos, 
+    wxImage& Resize( const wxSize& size, const wxPoint& pos,
                      int r = -1, int g = -1, int b = -1 ) { return *this = Size(size, pos, r, g, b); }
 
     // Rotates the image about the given point, 'angle' radians.
diff --git a/include/wx/imagjpeg.h b/include/wx/imagjpeg.h
index e51491e8f7..465947e67a 100644
--- a/include/wx/imagjpeg.h
+++ b/include/wx/imagjpeg.h
@@ -14,14 +14,16 @@
 #pragma interface "imagjpeg.h"
 #endif
 
-#include "wx/image.h"
-
+#include "wx/defs.h"
 
 //-----------------------------------------------------------------------------
 // wxJPEGHandler
 //-----------------------------------------------------------------------------
 
 #if wxUSE_LIBJPEG
+
+#include "wx/image.h"
+
 class WXDLLEXPORT wxJPEGHandler: public wxImageHandler
 {
 public:
@@ -42,7 +44,8 @@ public:
 private:
     DECLARE_DYNAMIC_CLASS(wxJPEGHandler)
 };
-#endif
+
+#endif // wxUSE_LIBJPEG
 
 #endif // _WX_IMAGJPEG_H_
 
diff --git a/include/wx/imagpng.h b/include/wx/imagpng.h
index 1f16de2002..73c465a90d 100644
--- a/include/wx/imagpng.h
+++ b/include/wx/imagpng.h
@@ -14,7 +14,7 @@
 #pragma interface "imagpng.h"
 #endif
 
-#include "wx/image.h"
+#include "wx/defs.h"
 
 //-----------------------------------------------------------------------------
 // wxPNGHandler
@@ -22,6 +22,8 @@
 
 #if wxUSE_LIBPNG
 
+#include "wx/image.h"
+
 #define wxIMAGE_OPTION_PNG_FORMAT    wxT("PngFormat")
 #define wxIMAGE_OPTION_PNG_BITDEPTH  wxT("PngBitDepth")
 
@@ -52,8 +54,9 @@ public:
 private:
     DECLARE_DYNAMIC_CLASS(wxPNGHandler)
 };
-#endif
 
+#endif
+  // wxUSE_LIBPNG
 
 #endif
   // _WX_IMAGPNG_H_
diff --git a/include/wx/imagtiff.h b/include/wx/imagtiff.h
index 44e8c6fa64..4c1a68cd43 100644
--- a/include/wx/imagtiff.h
+++ b/include/wx/imagtiff.h
@@ -14,6 +14,14 @@
 #pragma interface "imagtiff.h"
 #endif
 
+#include "wx/defs.h"
+
+//-----------------------------------------------------------------------------
+// wxTIFFHandler
+//-----------------------------------------------------------------------------
+
+#if wxUSE_LIBTIFF
+
 #include "wx/image.h"
 
 // defines for wxImage::SetOption
@@ -22,11 +30,6 @@
 #define wxIMAGE_OPTION_COMPRESSION                 wxString(_T("Compression"))
 #define wxIMAGE_OPTION_IMAGEDESCRIPTOR             wxString(_T("ImageDescriptor"))
 
-//-----------------------------------------------------------------------------
-// wxTIFFHandler
-//-----------------------------------------------------------------------------
-
-#if wxUSE_LIBTIFF
 class WXDLLEXPORT wxTIFFHandler: public wxImageHandler
 {
 public:
@@ -42,9 +45,8 @@ public:
 private:
     DECLARE_DYNAMIC_CLASS(wxTIFFHandler)
 };
-#endif
 
+#endif // wxUSE_LIBTIFF
 
-#endif
-  // _WX_IMAGTIFF_H_
+#endif // _WX_IMAGTIFF_H_
 
diff --git a/include/wx/joystick.h b/include/wx/joystick.h
index 1e07320f91..1fe2e6d55e 100644
--- a/include/wx/joystick.h
+++ b/include/wx/joystick.h
@@ -1,6 +1,19 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        joystick.h
+// Purpose:     wxJoystick base header
+// Author:      wxWidgets Team
+// Modified by:
+// Created:
+// Copyright:   (c) wxWidgets Team
+// RCS-ID:      $Id$
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
 #ifndef _WX_JOYSTICK_H_BASE_
 #define _WX_JOYSTICK_H_BASE_
 
+#include "wx/defs.h"
+
 #if wxUSE_JOYSTICK
 
 #if defined(__WXMSW__)
diff --git a/include/wx/listbase.h b/include/wx/listbase.h
index 97a3555fae..3d4cd4da72 100644
--- a/include/wx/listbase.h
+++ b/include/wx/listbase.h
@@ -16,6 +16,8 @@
 //    #pragma interface "listctrlbase.h"
 #endif
 
+#include "wx/defs.h"
+
 #if wxUSE_LISTCTRL
 
 #include "wx/colour.h"
diff --git a/include/wx/mdi.h b/include/wx/mdi.h
index 02f079f87b..6c393bcb5a 100644
--- a/include/wx/mdi.h
+++ b/include/wx/mdi.h
@@ -1,7 +1,18 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        mdi.h
+// Purpose:     wxMDI base header
+// Author:      wxWidgets Team
+// Modified by:
+// Created:
+// Copyright:   (c) wxWidgets Team
+// RCS-ID:      $Id$
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
 #ifndef _WX_MDI_H_BASE_
 #define _WX_MDI_H_BASE_
 
-#include "wx/setup.h"
+#include "wx/defs.h"
 
 #if wxUSE_MDI
 
diff --git a/include/wx/mediactrl.h b/include/wx/mediactrl.h
index 4caa45cc70..ce635aa383 100644
--- a/include/wx/mediactrl.h
+++ b/include/wx/mediactrl.h
@@ -26,9 +26,12 @@
 #pragma interface "mediactrl.h"
 #endif
 
+#include "wx/defs.h"
+
 // ----------------------------------------------------------------------------
 // Compilation guard
 // ----------------------------------------------------------------------------
+
 #if wxUSE_MEDIACTRL
 
 // ----------------------------------------------------------------------------
@@ -179,10 +182,10 @@ public:
     wxFileOffset Length(); //FIXME: This should be const
 
     //
-    // Unofficial parts of API 
+    // Unofficial parts of API
     //
     //DirectShow/GStreamer only.  Quicktime too, but somewhat buggy...
-    bool Load(const wxURI& location);  
+    bool Load(const wxURI& location);
 
     double GetPlaybackRate();           //All but MCI & GStreamer
     bool SetPlaybackRate(double dRate); //All but MCI & GStreamer
diff --git a/include/wx/menuitem.h b/include/wx/menuitem.h
index bdf8f5428f..c2607a04de 100644
--- a/include/wx/menuitem.h
+++ b/include/wx/menuitem.h
@@ -12,6 +12,8 @@
 #ifndef _WX_MENUITEM_H_BASE_
 #define _WX_MENUITEM_H_BASE_
 
+#include "wx/defs.h"
+
 #if wxUSE_MENUS
 
 // ----------------------------------------------------------------------------
diff --git a/include/wx/msgdlg.h b/include/wx/msgdlg.h
index b16aa2569d..2176ed6efb 100644
--- a/include/wx/msgdlg.h
+++ b/include/wx/msgdlg.h
@@ -12,7 +12,7 @@
 #ifndef _WX_MSGDLG_H_BASE_
 #define _WX_MSGDLG_H_BASE_
 
-#include "wx/setup.h"
+#include "wx/defs.h"
 
 #if wxUSE_MSGDLG
 
diff --git a/include/wx/mstream.h b/include/wx/mstream.h
index 2719d90474..a679e6bb8f 100644
--- a/include/wx/mstream.h
+++ b/include/wx/mstream.h
@@ -12,10 +12,12 @@
 #ifndef _WX_WXMMSTREAM_H__
 #define _WX_WXMMSTREAM_H__
 
-#include "wx/stream.h"
+#include "wx/defs.h"
 
 #if wxUSE_STREAMS
 
+#include "wx/stream.h"
+
 class WXDLLIMPEXP_BASE wxMemoryInputStream : public wxInputStream
 {
 public:
diff --git a/include/wx/ownerdrw.h b/include/wx/ownerdrw.h
index 7d388880bb..46ddedab28 100644
--- a/include/wx/ownerdrw.h
+++ b/include/wx/ownerdrw.h
@@ -12,6 +12,8 @@
 #ifndef   _OWNERDRW_H
 #define   _OWNERDRW_H
 
+#include "wx/defs.h"
+
 #if wxUSE_OWNER_DRAWN
 
 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
diff --git a/include/wx/popupwin.h b/include/wx/popupwin.h
index e0e5eefca9..9cd390d2fa 100644
--- a/include/wx/popupwin.h
+++ b/include/wx/popupwin.h
@@ -16,9 +16,12 @@
     #pragma interface "popupwinbase.h"
 #endif
 
-#include "wx/window.h"
+#include "wx/defs.h"
 
 #if wxUSE_POPUPWIN
+
+#include "wx/window.h"
+
 // ----------------------------------------------------------------------------
 // wxPopupWindow: a special kind of top level window used for popup menus,
 // combobox popups and such.
@@ -106,7 +109,7 @@ public:
 
     // Overridden to grab the input on some plaforms
     virtual bool Show( bool show = true );
-    
+
 protected:
     // common part of all ctors
     void Init();
diff --git a/include/wx/radiobut.h b/include/wx/radiobut.h
index 4485b1cc3f..a2daea5341 100644
--- a/include/wx/radiobut.h
+++ b/include/wx/radiobut.h
@@ -12,6 +12,8 @@
 #ifndef _WX_RADIOBUT_H_BASE_
 #define _WX_RADIOBUT_H_BASE_
 
+#include "wx/defs.h"
+
 #if wxUSE_RADIOBTN
 
 /*
diff --git a/include/wx/scrolbar.h b/include/wx/scrolbar.h
index c9272e99dd..0c2011c197 100644
--- a/include/wx/scrolbar.h
+++ b/include/wx/scrolbar.h
@@ -1,6 +1,19 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        scrolbar.h
+// Purpose:     wxScrollBar base header
+// Author:      wxWidgets Team
+// Modified by:
+// Created:
+// Copyright:   (c) wxWidgets Team
+// RCS-ID:      $Id$
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
 #ifndef _WX_SCROLBAR_H_BASE_
 #define _WX_SCROLBAR_H_BASE_
 
+#include "wx/defs.h"
+
 #if wxUSE_SCROLLBAR
 
 #include "wx/control.h"
diff --git a/include/wx/spinctrl.h b/include/wx/spinctrl.h
index ced3799506..7490dc4766 100644
--- a/include/wx/spinctrl.h
+++ b/include/wx/spinctrl.h
@@ -12,6 +12,10 @@
 #ifndef _WX_SPINCTRL_H_
 #define _WX_SPINCTRL_H_
 
+#include "wx/defs.h"
+
+#if wxUSE_SPINCTRL
+
 #include "wx/spinbutt.h"        // should make wxSpinEvent visible to the app
 
 // ----------------------------------------------------------------------------
@@ -72,5 +76,6 @@ protected:
 #define EVT_SPINCTRL(id, fn) \
     wx__DECLARE_EVT1(wxEVT_COMMAND_SPINCTRL_UPDATED, id, wxSpinEventHandler(fn))
 
-#endif // _WX_SPINCTRL_H_
+#endif // wxUSE_SPINCTRL
 
+#endif // _WX_SPINCTRL_H_
diff --git a/include/wx/statbox.h b/include/wx/statbox.h
index 41d29b05b9..362aeb7b17 100644
--- a/include/wx/statbox.h
+++ b/include/wx/statbox.h
@@ -1,6 +1,19 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        statbox.h
+// Purpose:     wxStaticBox base header
+// Author:      wxWidgets Team
+// Modified by:
+// Created:
+// Copyright:   (c) wxWidgets Team
+// RCS-ID:      $Id$
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
 #ifndef _WX_STATBOX_H_BASE_
 #define _WX_STATBOX_H_BASE_
 
+#include "wx/defs.h"
+
 #if wxUSE_STATBOX
 
 #include "wx/control.h"
diff --git a/include/wx/stattext.h b/include/wx/stattext.h
index ae85c17dad..cf49abca92 100644
--- a/include/wx/stattext.h
+++ b/include/wx/stattext.h
@@ -1,6 +1,19 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        stattext.h
+// Purpose:     wxStaticText base header
+// Author:      wxWidgets Team
+// Modified by:
+// Created:
+// Copyright:   (c) wxWidgets Team
+// RCS-ID:      $Id$
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
 #ifndef _WX_STATTEXT_H_BASE_
 #define _WX_STATTEXT_H_BASE_
 
+#include "wx/defs.h"
+
 #if wxUSE_STATTEXT
 
 #include "wx/control.h"
diff --git a/include/wx/stopwatch.h b/include/wx/stopwatch.h
index 08c8421ccc..d7abae28be 100644
--- a/include/wx/stopwatch.h
+++ b/include/wx/stopwatch.h
@@ -11,6 +11,7 @@
 #ifndef _WX_STOPWATCH_H_
 #define _WX_STOPWATCH_H_
 
+#include "wx/defs.h"
 #include "wx/longlong.h"
 
 // ----------------------------------------------------------------------------
diff --git a/include/wx/timer.h b/include/wx/timer.h
index 2ee202c106..f17a83a091 100644
--- a/include/wx/timer.h
+++ b/include/wx/timer.h
@@ -17,15 +17,15 @@
     #pragma interface "timerbase.h"
 #endif
 
-#include "wx/setup.h"
+#include "wx/defs.h"
+
+#if wxUSE_GUI && wxUSE_TIMER
+
 #include "wx/object.h"
 #include "wx/longlong.h"
 #include "wx/event.h"
-
 #include "wx/stopwatch.h" // for backwards compatibility
 
-#if wxUSE_GUI && wxUSE_TIMER
-
 // ----------------------------------------------------------------------------
 // wxTimer
 // ----------------------------------------------------------------------------
diff --git a/include/wx/tooltip.h b/include/wx/tooltip.h
index c20fc7b6d9..83a4eb9249 100644
--- a/include/wx/tooltip.h
+++ b/include/wx/tooltip.h
@@ -1,7 +1,18 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        tooltip.h
+// Purpose:     wxToolTip base header
+// Author:      wxWidgets Team
+// Modified by:
+// Created:
+// Copyright:   (c) wxWidgets Team
+// RCS-ID:      $Id$
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
 #ifndef _WX_TOOLTIP_H_BASE_
 #define _WX_TOOLTIP_H_BASE_
 
-#include "wx/setup.h"
+#include "wx/defs.h"
 
 #if wxUSE_TOOLTIPS
 
diff --git a/include/wx/treebase.h b/include/wx/treebase.h
index 51c4249027..c7c9aef476 100644
--- a/include/wx/treebase.h
+++ b/include/wx/treebase.h
@@ -20,6 +20,8 @@
 // headers
 // ----------------------------------------------------------------------------
 
+#include "wx/defs.h"
+
 #if wxUSE_TREECTRL
 
 #include "wx/window.h"  // for wxClientData
diff --git a/include/wx/wave.h b/include/wx/wave.h
index 97f3300774..2372a6d9b8 100644
--- a/include/wx/wave.h
+++ b/include/wx/wave.h
@@ -12,7 +12,7 @@
 #ifndef _WX_WAVE_H_BASE_
 #define _WX_WAVE_H_BASE_
 
-#include "wx/setup.h"
+#include "wx/defs.h"
 
 #if wxUSE_SOUND
 
diff --git a/include/wx/wizard.h b/include/wx/wizard.h
index 712ea4f7a1..a7d0250f1b 100644
--- a/include/wx/wizard.h
+++ b/include/wx/wizard.h
@@ -17,6 +17,8 @@
 #ifndef _WX_WIZARD_H_
 #define _WX_WIZARD_H_
 
+#include "wx/defs.h"
+
 #if wxUSE_WIZARDDLG
 
 // ----------------------------------------------------------------------------
diff --git a/include/wx/xpmdecod.h b/include/wx/xpmdecod.h
index f35b7f47ea..e4663a5b8f 100644
--- a/include/wx/xpmdecod.h
+++ b/include/wx/xpmdecod.h
@@ -14,7 +14,7 @@
 #pragma interface "xpmdecod.h"
 #endif
 
-#include "wx/setup.h"
+#include "wx/defs.h"
 
 
 class WXDLLIMPEXP_CORE wxImage;
diff --git a/src/common/socket.cpp b/src/common/socket.cpp
index 4d98262d30..f4f42cc31f 100644
--- a/src/common/socket.cpp
+++ b/src/common/socket.cpp
@@ -40,6 +40,7 @@
 
 #include "wx/sckaddr.h"
 #include "wx/socket.h"
+#include "wx/stopwatch.h"
 
 // DLL options compatibility check:
 #include "wx/build.h"
-- 
2.47.2