Home » Developing U++ » Mac OS » Conditional compiling
|
|
Re: Conditional compiling [message #51366 is a reply to message #51365] |
Fri, 15 March 2019 23:04 |
|
Klugier
Messages: 1076 Registered: September 2012 Location: Poland, Kraków
|
Senior Contributor |
|
|
Hello,
It seems that for the UI applications Mirek is using PLATFORM_COCOA. Here is part of TheIDE that creates macOS global menu (ide/idebar.cpp - line 879):
void Ide::SetMenuBar()
{
#ifdef PLATFORM_COCOA
SetMainMenu(THISBACK(MainMenu));
menubar.Hide();
#else
menubar.Set(THISBACK(MainMenu));
#endif
}
However, it is only true if Cocoa back-end is enable (currently default and the most advanced one for macOS). So, you can not relay on this flag for your console applications.
In the Core/config.h file there are following platform definitions that are equal on macOS:
#define PLATFORM_MACOS 1
#define PLATFORM_OSX 1
The above declaration are good to check for platform in low level code that doesn't require UI elements. Currently, I would prefer PLATFORM_MACOS over PLATFORM_OSX, because it agrees with current Apple naming convention for their desktop operating system. MAC OS X naming was abandon in 2016. Also, please notice that macOS is POSIX platform, so in most non UI cases you should relay on PLATFORM_POSIX flag.
Sincerely,
Klugier
U++ - one framework to rule them all.
[Updated on: Fri, 15 March 2019 23:08] Report message to a moderator
|
|
|
|
Goto Forum:
Current Time: Wed May 15 05:28:34 CEST 2024
Total time taken to generate the page: 0.02198 seconds
|