From f4d44aa7ee97b0944bbc57bc26074b26e7818e84 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Mon, 3 Nov 2025 21:03:46 +0100 Subject: [PATCH 44/48] additional platform defines --- docs/doxygen/mainpages/const_cpp.h | 3 +++ include/wx/platform.h | 15 +++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/docs/doxygen/mainpages/const_cpp.h b/docs/doxygen/mainpages/const_cpp.h index 5916656d83..c43b2d6cc6 100644 --- a/docs/doxygen/mainpages/const_cpp.h +++ b/docs/doxygen/mainpages/const_cpp.h @@ -43,6 +43,9 @@ while \__WINDOWS__ should be used for the platform tests.} @itemdef{\__WXOSX_IPHONE__, iPhone (UIKit)} @itemdef{\__WXOSX_COCOA__, macOS using Cocoa (AppKit)} @itemdef{\__WXOSX_MAC__, macOS (Cocoa)} +@itemdef{\__WXDARWIN__, wxBase built on macOS or iPhone, synonym of \__DARWIN__ (see below)} +@itemdef{\__WXDARWIN_OSX__, wxBase built on macOS (can be used for with Apple and non-Apple GUIs)} +@itemdef{\__WXDARWIN_IPHONE__, wxBase built on iPhone} @itemdef{\__WXPM__, OS/2 native Presentation Manager (not used any longer).} @itemdef{\__WXXT__, Xt; mutually exclusive with WX_MOTIF, not implemented in wxWidgets 2.x} @itemdef{\__WXX11__, wxX11 (\__WXUNIVERSAL__ will be also defined)} diff --git a/include/wx/platform.h b/include/wx/platform.h index 527bb437f5..34f607c488 100644 --- a/include/wx/platform.h +++ b/include/wx/platform.h @@ -421,6 +421,21 @@ #ifdef __DARWIN__ # if defined(__MACH__) +# ifndef __WXDARWIN__ +# define __WXDARWIN__ 1 +# endif +# include +# if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE +/* this branch is also true for tv, catalyst, watch and vision */ +# ifndef __WXDARWIN_IPHONE__ +# define __WXDARWIN_IPHONE__ 1 +# endif +# elif defined(TARGET_OS_OSX) && TARGET_OS_OSX +# ifndef __WXDARWIN_IPHONE__ +# define __WXDARWIN_OSX__ 1 +# endif +# endif + # include # ifndef MAC_OS_X_VERSION_10_4 # define MAC_OS_X_VERSION_10_4 1040 -- 2.24.3 (Apple Git-128)