+
+/* backwards compatible define, until configure gets updated */
+#if defined __WXMAC__
+#define __WXOSX_CARBON__
+#endif
+
+#if defined(__WXOSX_CARBON__) || defined(__WXOSX_COCOA__) || defined(__WXOSX_IPHONE__)
+# define __WXOSX__
+#endif
+
+#ifdef __WXOSX__
+/* for backwards compatibility of code (including our own) define __WXMAC__ */
+# ifndef __WXMAC__
+# define __WXMAC__
+# endif
+/* setup precise defines according to sdk used */
+# include <TargetConditionals.h>
+# if defined(__WXOSX_IPHONE__)
+# if !( defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE )
+# error "incorrect SDK for an iPhone build"
+# endif
+# elif defined(__WXOSX_CARBON__) || defined(__WXOSX_COCOA__)
+# if !( defined(TARGET_OS_MAC) && TARGET_OS_MAC )
+# error "incorrect SDK for a Mac OS X build"
+# endif
+# define __WXOSX_MAC__
+# else
+# error "one of __WXOSX_IPHONE__, __WXOSX_CARBON__ or __WXOSX_COCOA__ must be defined"
+# endif
+#endif
+
+#ifdef __WXOSX_MAC__