]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/defs.h
wxToolBarTool::IsXXX() should return bool, not int
[wxWidgets.git] / include / wx / defs.h
index 5de3bdf6974dc077e576066a3fdf6837f48f1529..8a70d08344c0ea6ee9151c3941f6e85d728114eb 100644 (file)
@@ -70,7 +70,7 @@
 // using this macro allows constuctions like "wxSTD iostream" to work in
 // either case
 #if !wxUSE_IOSTREAMH
- #define wxSTD std::
 #define wxSTD std::
 #else
  #define wxSTD
 #endif
 
         #include <Carbon/Carbon.h>
     #endif // __WXMAC__ && __DARWIN__
+
+    #if defined(__CYGWIN__)
+        #if !defined(wxSIZE_T_IS_UINT)
+            #define wxSIZE_T_IS_UINT
+        #endif
+    #endif
 #elif defined(applec) || \
       defined(THINK_C) || \
       (defined(__MWERKS__) && !defined(__INTEL__))
@@ -417,79 +423,48 @@ typedef int wxWindowID;
 // ----------------------------------------------------------------------------
 
 #if defined(__WXMSW__)
-
-// __declspec works in BC++ 5 and later, Watcom C++ 11.0 and later as well as VC++ and gcc
-#if defined(__VISUALC__) || defined(__BORLANDC__) || defined(__GNUC__) || defined(__WATCOMC__)
-#  ifdef WXMAKINGDLL
-#    define WXDLLEXPORT __declspec( dllexport )
-#    define WXDLLEXPORT_DATA(type) __declspec( dllexport ) type
-#    define WXDLLEXPORT_CTORFN
-#  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
-#else
-#    define WXDLLEXPORT
-#    define WXDLLEXPORT_DATA(type) type
-#    define WXDLLEXPORT_CTORFN
-#endif
-
+    // __declspec works in BC++ 5 and later, Watcom C++ 11.0 and later as well
+    // as VC++ and gcc
+    #if defined(__VISUALC__) || defined(__BORLANDC__) || defined(__GNUC__) || defined(__WATCOMC__)
+        #define WXEXPORT __declspec(dllexport)
+        #define WXIMPORT __declspec(dllimport)
+    #else // compiler doesn't support __declspec()
+        #define WXEXPORT
+        #define WXIMPORT
+    #endif
 #elif defined(__WXPM__)
+    #if defined (__WATCOMC__)
+        #define WXEXPORT __declspec(dllexport)
+        // __declspec(dllimport) prepends __imp to imported symbols. We do NOT
+        // want that!
+        #define WXIMPORT
+    #elif (!(defined(__VISAGECPP__) && (__IBMCPP__ < 400 || __IBMC__ < 400 )))
+        #define WXEXPORT _Export
+        #define WXIMPORT _Export
+    #endif
+#endif
 
-#  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
-#      define WXDLLEXPORT_DATA(type) _Export type
-#      define WXDLLEXPORT_CTORFN
-#    elif defined(WXUSINGDLL)
-#      define WXDLLEXPORT _Export
-#      define WXDLLEXPORT_DATA(type) _Export type
-#      define WXDLLEXPORT_CTORFN
-#    else
-#      define WXDLLEXPORT
-#      define WXDLLEXPORT_DATA(type) type
-#      define WXDLLEXPORT_CTORFN
-#    endif
-
-#  else
-
-#    define WXDLLEXPORT
-#    define WXDLLEXPORT_DATA(type) type
-#    define WXDLLEXPORT_CTORFN
-
-#  endif
-
-#else  // !(MSW or OS2)
-
-#  define WXDLLEXPORT
-#  define WXDLLEXPORT_DATA(type) type
-#  define WXDLLEXPORT_CTORFN
-
+// for other platforms/compilers we don't anything
+#ifndef WXEXPORT
+    #define WXEXPORT
+    #define WXIMPORT
 #endif
 
+// WXDLLEXPORT maps to export declaration when building the DLL, to import
+// declaration if using it or to nothing at all if we don't use wxWin DLL
+#ifdef WXMAKINGDLL
+    #define WXDLLEXPORT WXEXPORT
+    #define WXDLLEXPORT_DATA(type) WXEXPORT type
+    #define WXDLLEXPORT_CTORFN
+#elif defined(WXUSINGDLL)
+    #define WXDLLEXPORT WXIMPORT
+    #define WXDLLEXPORT_DATA(type) WXIMPORT type
+    #define WXDLLEXPORT_CTORFN
+#else // not making nor using DLL
+    #define WXDLLEXPORT
+    #define WXDLLEXPORT_DATA(type) type
+    #define WXDLLEXPORT_CTORFN
+#endif
 
 // For ostream, istream ofstream
 #if defined(__BORLANDC__) && defined( _RTLDLL )
@@ -1951,7 +1926,7 @@ typedef struct tagLOGPALETTE
 #elif defined(__WIN32__)
     typedef int (__stdcall *WXFARPROC)();
 #elif defined(__WXPM__)
-#  if (defined(__VISAGECPP__) && (__IBMCPP__ < 400 || __IBMC__ < 400 )) || defined (__WATCOMC__)
+#  if (defined(__VISAGECPP__) && (__IBMCPP__ < 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