# macos.h

Go to the documentation of this file.

    00001 /* $Id: macos.h 17706 2009-10-04 21:08:30Z michi_cc $ */
    00002
    00003 /*
    00004  * This file is part of OpenTTD.
    00005  * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
    00006  * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    00007  * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
    00008  */
    00009
    00012 #ifndef MACOS_H
    00013 #define MACOS_H
    00014
    00015 /* It would seem that to ensure backward compability we have to ensure that we have defined MAC_OS_X_VERSION_10_x everywhere */
    00016 #ifndef MAC_OS_X_VERSION_10_3
    00017 #define MAC_OS_X_VERSION_10_3 1030
    00018 #endif
    00019
    00020 #ifndef MAC_OS_X_VERSION_10_4
    00021 #define MAC_OS_X_VERSION_10_4 1040
    00022 #endif
    00023
    00024 #ifndef MAC_OS_X_VERSION_10_5
    00025 #define MAC_OS_X_VERSION_10_5 1050
    00026 #endif
    00027
    00028 #ifndef MAC_OS_X_VERSION_10_6
    00029 #define MAC_OS_X_VERSION_10_6 1060
    00030 #endif
    00031
    00032
    00034 void ShowMacDialog(const char *title, const char *message, const char *button_label);
    00035
    00036 void GetMacOSVersion(int *return_major, int *return_minor, int *return_bugfix);
    00037
    00045 static inline bool MacOSVersionIsAtLeast(long major, long minor, long bugfix)
    00046 {
    00047   int version_major, version_minor, version_bugfix;
    00048   GetMacOSVersion(&version_major, &version_minor, &version_bugfix);
    00049
    00050   if (version_major < major) return false;
    00051   if (version_major == major && version_minor < minor) return false;
    00052   if (version_major == major && version_minor == minor && version_bugfix < bugfix) return false;
    00053
    00054   return true;
    00055 }
    00056
    00057 #endif /* MACOS_H */