thecocce / fog

Automatically exported from code.google.com/p/fog
0 stars 0 forks source link

Add FOG_OS_MAC macro for Mac OS X detection #4

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
This is actually very easy: 

#if defined(__APPLE__) 
# define FOG_OS_DEFINED
# define FOG_OS_MAC
#endif

Niels

Original issue reported on code.google.com by niels.pf...@gmail.com on 24 Nov 2009 at 3:38

GoogleCodeExporter commented 8 years ago
Ah, I'm sorry. This is still available! embarrasing!

Original comment by niels.pf...@gmail.com on 24 Nov 2009 at 3:41

GoogleCodeExporter commented 8 years ago
Hi Niels,

How is difference between __APPLE__ and __DARWIN__, is this valid?

#if !defined(FOG_OS_DEFINED) && defined(__DARWIN__)
# define FOG_OS_DEFINED
# define FOG_OS_MAC
#endif // __DARWIN__

Or it should be updated to?

#if !defined(FOG_OS_DEFINED) && (defined(__DARWIN__) || defined(__APPLE__)
# define FOG_OS_DEFINED
# define FOG_OS_MAC
#endif // __DARWIN__

Original comment by kobalicek.petr on 25 Nov 2009 at 6:40

GoogleCodeExporter commented 8 years ago
Hi Petr, 

I actually don't know the correct answer, but when searching on Google for
"__DARWIN__ __APPLE__", you get many issues, where __DARWIN__ was changed to 
__APPLE__. 

So I think, "(defined(__DARWIN__) || defined(__APPLE__))" is the best way. 

Best regards

Original comment by niels.pf...@gmail.com on 25 Nov 2009 at 6:24

GoogleCodeExporter commented 8 years ago
Fixed in my local copy, will be commited later

Original comment by kobalicek.petr on 27 Nov 2009 at 8:36

GoogleCodeExporter commented 8 years ago
Fixed in trunk

Original comment by kobalicek.petr on 12 Dec 2009 at 2:10