Rework the trip history window layout.
[openttd-joker.git] / src / os / macosx / G5_detector.cpp
blob93688af8ee132ea25440c5c03eaf79bd48482758
1 /* $Id: G5_detector.cpp 24524 2012-09-13 18:42:33Z yexo $ */
3 /*
4 * This file is part of OpenTTD.
5 * 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.
6 * 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.
7 * 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/>.
8 */
10 /** @file G5_detector.cpp Detection for G5 machines (PowerPC). */
12 #include <mach/mach.h>
13 #include <mach/mach_host.h>
14 #include <mach/host_info.h>
15 #include <mach/machine.h>
16 #include <stdio.h>
19 #ifndef CPU_SUBTYPE_POWERPC_970
20 #define CPU_SUBTYPE_POWERPC_970 ((cpu_subtype_t) 100)
21 #endif
23 /* this function is a lightly modified version of some code from Apple's developer homepage to detect G5 CPUs at runtime */
24 int main()
26 host_basic_info_data_t hostInfo;
27 mach_msg_type_number_t infoCount;
28 boolean_t is_G5;
30 infoCount = HOST_BASIC_INFO_COUNT;
31 host_info(mach_host_self(), HOST_BASIC_INFO,
32 (host_info_t)&hostInfo, &infoCount);
34 is_G5 = ((hostInfo.cpu_type == CPU_TYPE_POWERPC) &&
35 (hostInfo.cpu_subtype == CPU_SUBTYPE_POWERPC_970));
36 if (is_G5)
37 printf("1");