macos.h
Go to the documentation of this file.00001
00002
00005 #ifndef MACOS_H
00006 #define MACOS_H
00007
00008
00009 #ifndef MAC_OS_X_VERSION_10_3
00010 #define MAC_OS_X_VERSION_10_3 1030
00011 #endif
00012
00013 #ifndef MAC_OS_X_VERSION_10_4
00014 #define MAC_OS_X_VERSION_10_4 1040
00015 #endif
00016
00017 #ifndef MAC_OS_X_VERSION_10_5
00018 #define MAC_OS_X_VERSION_10_5 1050
00019 #endif
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 void ShowMacDialog ( const char *title, const char *message, const char *buttonLabel );
00031 void ShowMacAssertDialog ( const char *function, const char *file, const int line, const char *expression );
00032 void ShowMacErrorDialog(const char *error);
00033
00034
00035
00036 #undef assert
00037
00038 #ifdef NDEBUG
00039 #define assert(e) ((void)0)
00040 #else
00041
00042 #define assert(e) \
00043 (__builtin_expect(!(e), 0) ? ShowMacAssertDialog ( __func__, __FILE__, __LINE__, #e ): (void)0 )
00044 #endif
00045
00046
00047
00052 long GetMacOSVersionMajor();
00053
00058 long GetMacOSVersionMinor();
00059
00064 long GetMacOSVersionBugfix();
00065
00073 static inline bool MacOSVersionIsAtLeast(long major, long minor, long bugfix)
00074 {
00075 long maj = GetMacOSVersionMajor();
00076 long min = GetMacOSVersionMinor();
00077 long bf = GetMacOSVersionBugfix();
00078
00079 if (maj < major) return false;
00080 if (maj == major && min < minor) return false;
00081 if (maj == major && min == minor && bf < bugfix) return false;
00082
00083 return true;
00084 }
00085
00086 #endif