]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/defs.h
Implemented wxMenuBar::Insert and wxMenu::Insert.
[wxWidgets.git] / include / wx / defs.h
index e4f6b3d8652ab60274a540524a326084e0bb4473..0e06ffcb0f2d0c09819c5bc59ea4db994d7b9c54 100644 (file)
@@ -292,6 +292,29 @@ typedef int wxWindowID;
     #define wx_reinterpret_cast(t, x) ((t)(x))
 #endif
 
+/*
+   This one is a wx invention: like static cast but used when we intentionally
+   truncate from a larger to smaller type, static_cast<> can't be used for it
+   as it results in warnings when using some compilers (SGI mipspro for example)
+ */
+#if defined(__INTELC__) && defined(__cplusplus)
+    template <typename T, typename X>
+    inline T wx_truncate_cast_impl(X x)
+    {
+        #pragma warning(push)
+        /* explicit conversion of a 64-bit integral type to a smaller integral type */
+        #pragma warning(disable: 1683)
+
+        return (T)x;
+
+        #pragma warning(pop)
+    }
+
+    #define wx_truncate_cast(t, x) wx_truncate_cast_impl<t>(x)
+#else /* !__INTELC__ */
+    #define wx_truncate_cast(t, x) ((t)(x))
+#endif /* __INTELC__/!__INTELC__ */
+
 /* for consistency with wxStatic/DynamicCast defined in wx/object.h */
 #define wxConstCast(obj, className) wx_const_cast(className *, obj)
 
@@ -573,7 +596,7 @@ typedef int wxWindowID;
     #define except(x) catch(...)
 #endif /*  Metrowerks */
 
-#if defined(__WATCOMC__)
+#if defined(__WATCOMC__) && (__WATCOMC__ < 1240)
     typedef short mode_t;
 #endif
 
@@ -638,14 +661,7 @@ enum
 /*  ---------------------------------------------------------------------------- */
 
 /*  the type for screen and DC coordinates */
-
-#if wxUSE_COMPATIBLE_COORD_TYPES
-    /*  to ensure compatibility with 2.0, we must use long */
-    #define wxCoord long
-#else  /*  !wxUSE_COMPATIBLE_COORD_TYPES */
-        /*  other platforms we support have at least 32bit int - quite enough */
-        typedef int wxCoord;
-#endif /*  wxUSE_COMPATIBLE_COORD_TYPES/!wxUSE_COMPATIBLE_COORD_TYPES */
+typedef int wxCoord;
 
 enum {  wxDefaultCoord = -1 };
 
@@ -844,29 +860,43 @@ inline wxUIntPtr wxPtrToUInt(const void *p)
     /*
        VC++ 7.1 gives warnings about casts such as below even when they're
        explicit with /Wp64 option, suppress them as we really know what we're
-       doing here
+       doing here. Same thing with icc with -Wall.
      */
-#ifdef __VISUALC__
-    #pragma warning(disable: 4311) /* pointer truncation from '' to '' */
+#if defined(__VISUALC__) || defined(__INTELC__)
+    #pragma warning(push)
+    #ifdef __VISUALC__
+        /* pointer truncation from '' to '' */
+        #pragma warning(disable: 4311)
+    #elif defined(__INTELC__)
+        /* conversion from pointer to same-sized integral type */
+        #pragma warning(disable: 1684)
+    #endif
 #endif
 
     return wx_reinterpret_cast(wxUIntPtr, p);
 
-#ifdef __VISUALC__
-    #pragma warning(default: 4311)
+#if defined(__VISUALC__) || defined(__INTELC__)
+    #pragma warning(pop)
 #endif
 }
 
 inline void *wxUIntToPtr(wxUIntPtr p)
 {
-#ifdef __VISUALC__
-    #pragma warning(disable: 4312) /* conversion to type of greater size */
+#if defined(__VISUALC__) || defined(__INTELC__)
+    #pragma warning(push)
+    #ifdef __VISUALC__
+        /* conversion to type of greater size */
+        #pragma warning(disable: 4312)
+    #elif defined(__INTELC__)
+        /* invalid type conversion: "wxUIntPtr={unsigned long}" to "void *" */
+        #pragma warning(disable: 171)
+    #endif
 #endif
 
     return wx_reinterpret_cast(void *, p);
 
-#ifdef __VISUALC__
-    #pragma warning(default: 4312)
+#if defined(__VISUALC__) || defined(__INTELC__)
+    #pragma warning(pop)
 #endif
 }
 #endif /*__cplusplus*/
@@ -902,7 +932,7 @@ inline void *wxUIntToPtr(wxUIntPtr p)
     #define wxLongLong_t __int64
     #define wxLongLongSuffix i64
     #define wxLongLongFmtSpec _T("L")
-#elif (defined(__WATCOMC__) && (defined(__WIN32__) || defined(__DOS__)))
+#elif (defined(__WATCOMC__) && (defined(__WIN32__) || defined(__DOS__) || defined(__OS2__)))
       #define wxLongLong_t __int64
       #define wxLongLongSuffix i64
       #define wxLongLongFmtSpec _T("L")
@@ -963,6 +993,9 @@ inline void *wxUIntToPtr(wxUIntPtr p)
 #if defined(__PALMOS__) && !defined(HAVE_SSIZE_T)
     #define HAVE_SSIZE_T
 #endif
+#if defined(__WATCOMC__) && __WATCOMC__ > 1230
+    #define HAVE_SSIZE_T
+#endif
 #ifndef HAVE_SSIZE_T
     #if SIZEOF_SIZE_T == 4
         typedef wxInt32 ssize_t;
@@ -1803,6 +1836,8 @@ enum wxHitTest
 #define wxSIZE_ALLOW_MINUS_ONE  0x0004
 /*  Don't do parent client adjustments (for implementation only) */
 #define wxSIZE_NO_ADJUSTMENTS   0x0008
+/*  Change the window position even if it seems to be already correct */
+#define wxSIZE_FORCE            0x0010
 
 /*  ---------------------------------------------------------------------------- */
 /*  GDI descriptions */
@@ -2672,6 +2707,7 @@ typedef void*           WXRegion;
 typedef void*           WXFont;
 typedef void*           WXImage;
 typedef void*           WXFontList;
+typedef void*           WXFontSet;
 typedef void*           WXRendition;
 typedef void*           WXRenderTable;
 typedef void*           WXFontType; /* either a XmFontList or XmRenderTable */