Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » Mac OS » Conditional compiling
Re: Conditional compiling [message #51366 is a reply to message #51365] Fri, 15 March 2019 23:04 Go to previous messageGo to previous message
Klugier is currently offline  Klugier
Messages: 1077
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

 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Problem with macOs compiling in Linux
Next Topic: Cannot compile plugin/ftp
Goto Forum:
  


Current Time: Fri Jun 07 00:28:18 CEST 2024

Total time taken to generate the page: 0.01663 seconds