]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/defs.h
Update OpenVMS compile support (problem cairo logical)
[wxWidgets.git] / include / wx / defs.h
index d9aad8ce61b3d6732d66e6fc0d4c8bf5a49bff65..fd2e5ead1f047b1067b7fa0dc44b25b5e267910a 100644 (file)
 #   pragma warning(disable:4355)    /* 'this' used in base member initializer list */
 #   pragma warning(disable:4511)    /*  copy ctor couldn't be generated */
 #   pragma warning(disable:4512)    /*  operator=() couldn't be generated */
+#   pragma warning(disable:4514)   /*  unreferenced inline func has been removed */
 #   pragma warning(disable:4710)    /*  function not inlined */
 
+    // TODO: this warning should really be enabled as it can be genuinely
+    //       useful, check where does it occur in wxWidgets
+    #pragma warning(disable: 4127) /*  conditional expression is constant */
+
     /* There are too many false positivies for this one, particularly when
        using templates like wxVector<T> */
     /* class 'foo' needs to have dll-interface to be used by clients of
        class 'bar'" */
 #   pragma warning(disable:4251)
 
+#   ifdef __VISUALC5__
     /* For VC++ 5.0 for release mode, the warning 'C4702: unreachable code */
     /* is buggy, and occurs for code that does actually get executed */
-#   if !defined __WXDEBUG__ && __VISUALC__ <= 1100
+#   ifndef __WXDEBUG__
 #       pragma warning(disable:4702)    /* unreachable code */
 #   endif
+
     /* The VC++ 5.0 warning 'C4003: not enough actual parameters for macro'
      * is incompatible with the wxWidgets headers since it is given when
      * parameters are empty but not missing. */
-#   if __VISUALC__ <= 1100
 #       pragma warning(disable:4003)    /* not enough actual parameters for macro */
 #   endif
 
+    /*
+       VC6 insists on complaining about 
+
+        return type for 'wxVector<T>::reverse_iterator::operator ->' is 'T **'
+        (ie; not a UDT or reference to a UDT.  Will produce errors if applied
+        using infix notation)
+
+       which is perfectly fine because template classes do routinely define
+       operators which don't make sense for all template parameter values
+       (besides this warning was removed in subsequent versions).
+     */
+    #ifdef __VISUALC6__
+        #pragma warning(disable: 4284)
+    #endif // VC6
+
     /*
        When compiling with VC++ 7 /Wp64 option we get thousands of warnings for
        conversion from size_t to int or long. Some precious few of them might
@@ -582,6 +603,17 @@ typedef short int WXTYPE;
     #define wxDEPRECATED(x) x
 #endif
 
+/*
+    explicitly specifying inline allows gcc < 3.4 to
+    handle the deprecation attribute even in the constructor.
+    doesn't seem to work on Apple's gcc 4.0.1 unless using -O0
+*/
+#if defined( __DARWIN__ ) && !defined(__WXDEBUG__)
+    #define  wxDEPRECATED_CONSTRUCTOR(x) x
+#else
+    #define  wxDEPRECATED_CONSTRUCTOR(x) wxDEPRECATED( inline x)
+#endif
+    
 /*
    Macro which marks the function as being deprecated but also defines it
    inline.
@@ -639,6 +671,15 @@ typedef short int WXTYPE;
             ptr = NULL;
         }
     }
+
+    // trivial implementation of std::swap() for primitive types
+    template <typename T>
+    inline void wxSwap(T& first, T& second)
+    {
+        T tmp(first);
+        first = second;
+        second = tmp;
+    }
 #endif /*__cplusplus*/
 
 /*  size of statically declared array */
@@ -766,18 +807,6 @@ typedef short int WXTYPE;
 /*  compiler specific settings */
 /*  ---------------------------------------------------------------------------- */
 
-/*  to allow compiling with warning level 4 under Microsoft Visual C++ some */
-/*  warnings just must be disabled */
-#ifdef  __VISUALC__
-  #pragma warning(disable: 4514) /*  unreferenced inline func has been removed */
-/*
-  you might be tempted to disable this one also: triggered by CHECK and FAIL
-  macros in debug.h, but it's, overall, a rather useful one, so I leave it and
-  will try to find some way to disable this warning just for CHECK/FAIL. Anyone?
-*/
-  #pragma warning(disable: 4127) /*  conditional expression is constant */
-#endif  /*  VC++ */
-
 #if defined(__MWERKS__)
     #undef try
     #undef except
@@ -1537,7 +1566,7 @@ enum wxAlignment
 enum wxSizerFlagBits
 {
     /* for compatibility only, default now, don't use explicitly any more */
-#if WXWIN_COMPATIBILITY_2_6
+#if WXWIN_COMPATIBILITY_2_8
     wxADJUST_MINSIZE               = 0,
 #endif
     wxFIXED_MINSIZE                = 0x8000,
@@ -1866,8 +1895,10 @@ enum wxBorder
 #define wxAPPLY                 0x00000020
 #define wxCLOSE                 0x00000040
 
-#define wxYES_DEFAULT           0x00000000  /*  has no effect (default) */
-#define wxNO_DEFAULT            0x00000080
+#define wxOK_DEFAULT            0x00000000  /* has no effect (default) */
+#define wxYES_DEFAULT           0x00000000  /* has no effect (default) */
+#define wxNO_DEFAULT            0x00000080  /* only valid with wxYES_NO */
+#define wxCANCEL_DEFAULT        0x80000000  /* only valid with wxCANCEL */
 
 #define wxICON_EXCLAMATION      0x00000100
 #define wxICON_HAND             0x00000200
@@ -2644,6 +2675,21 @@ enum wxUpdateUI
     wxUPDATE_UI_FROMIDLE      = 0x0002 /*  Invoked from On(Internal)Idle */
 };
 
+
+/* ---------------------------------------------------------------------------- */
+/* wxList types */
+/* ---------------------------------------------------------------------------- */
+
+/* type of compare function for list sort operation (as in 'qsort'): it should
+   return a negative value, 0 or positive value if the first element is less
+   than, equal or greater than the second */
+
+typedef int (* LINKAGEMODE wxSortCompareFunction)(const void *elem1, const void *elem2);
+
+/* wxList iterator function */
+typedef int (* LINKAGEMODE wxListIterateFunction)(void *current);
+
+
 /*  ---------------------------------------------------------------------------- */
 /*  miscellaneous */
 /*  ---------------------------------------------------------------------------- */