macos.h
00001
00002
00003 #ifndef MACOS_H
00004 #define MACOS_H
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 void ShowMacDialog ( const char *title, const char *message, const char *buttonLabel );
00015 void ShowMacAssertDialog ( const char *function, const char *file, const int line, const char *expression );
00016 void ShowMacErrorDialog(const char *error);
00017
00018
00019
00020 #undef assert
00021
00022 #ifdef NDEBUG
00023 #define assert(e) ((void)0)
00024 #else
00025
00026 #define assert(e) \
00027 (__builtin_expect(!(e), 0) ? ShowMacAssertDialog ( __func__, __FILE__, __LINE__, #e ): (void)0 )
00028 #endif
00029
00030
00031
00036 long GetMacOSVersionMajor();
00037
00042 long GetMacOSVersionMinor();
00043
00048 long GetMacOSVersionBugfix();
00049
00057 static inline bool MacOSVersionIsAtLeast(long major, long minor, long bugfix)
00058 {
00059 long maj = GetMacOSVersionMajor();
00060 long min = GetMacOSVersionMinor();
00061 long bf = GetMacOSVersionBugfix();
00062
00063 if (maj < major) return false;
00064 if (maj == major && min < minor) return false;
00065 if (maj == major && min == minor && bf < bugfix) return false;
00066
00067 return true;
00068 }
00069
00070 #endif