]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/defs.h
Fix a couple of export declarations
[wxWidgets.git] / include / wx / defs.h
index 674b4db3e1a25d076deb4fd981ed3fd59531672b..18a82b4c687975c07ad6348f513c087cac541cbb 100644 (file)
@@ -298,18 +298,35 @@ typedef int wxWindowID;
     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)
+        /* implicit conversion of a 64-bit integral type to a smaller integral type */
+        #pragma warning(disable: 1682)
+        /* conversion from "X" to "T" may lose significant bits */
+        #pragma warning(disable: 810)
 
-        return (T)x;
+        return x;
 
         #pragma warning(pop)
     }
 
     #define wx_truncate_cast(t, x) wx_truncate_cast_impl<t>(x)
-#else /* !__INTELC__ */
+
+#elif defined(__cplusplus) && defined(__VISUALC__) && __VISUALC__ >= 1310
+    template <typename T, typename X>
+    inline T wx_truncate_cast_impl(X x)
+    {
+        #pragma warning(push)
+        /* conversion from 'X' to 'T', possible loss of data */
+        #pragma warning(disable: 4267)
+
+        return x;
+
+        #pragma warning(pop)
+    }
+
+    #define wx_truncate_cast(t, x) wx_truncate_cast_impl<t>(x)
+#else
     #define wx_truncate_cast(t, x) ((t)(x))
-#endif /* __INTELC__/!__INTELC__ */
+#endif
 
 /* for consistency with wxStatic/DynamicCast defined in wx/object.h */
 #define wxConstCast(obj, className) wx_const_cast(className *, obj)