Panda3D
dtool_platform.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file dtool_platform.h
10  * @author drose
11  * @date 2009-08-03
12  */
13 
14 #ifndef DTOOL_PLATFORM_H
15 #define DTOOL_PLATFORM_H
16 
17 /* This file defines the macro DTOOL_PLATFORM, which is used in
18  PandaSystem and a few other places to report the current platform
19  string. In practice, this string is primarily useful for the
20  packaged runtime system. */
21 
22 #include "dtool_config.h"
23 
24 #if defined(DTOOL_PLATFORM)
25 // This has already been defined explicitly by the Config.pp file.
26 
27 #elif defined(_WIN64)
28 #define DTOOL_PLATFORM "win_amd64"
29 
30 #elif defined(_WIN32)
31 #define DTOOL_PLATFORM "win_i386"
32 
33 #elif defined(__APPLE__)
34 #if defined(BUILD_IPHONE)
35 #define DTOOL_PLATFORM "iphone"
36 #elif defined(__ppc__)
37 #define DTOOL_PLATFORM "osx_ppc"
38 #elif defined(__i386__)
39 #define DTOOL_PLATFORM "osx_i386"
40 #elif defined(__x86_64)
41 #define DTOOL_PLATFORM "osx_amd64"
42 #endif
43 
44 #elif defined(__FreeBSD__)
45 #if defined(__x86_64)
46 #define DTOOL_PLATFORM "freebsd_amd64"
47 #elif defined(__i386__)
48 #define DTOOL_PLATFORM "freebsd_i386"
49 #endif
50 
51 #elif defined(__ANDROID__)
52 #if defined(__ARM_ARCH_7A__)
53 #define DTOOL_PLATFORM "android_armv7a"
54 #elif defined(__aarch64__)
55 #define DTOOL_PLATFORM "android_aarch64"
56 #elif defined(__arm__)
57 #define DTOOL_PLATFORM "android_arm"
58 #elif defined(__mips__)
59 #define DTOOL_PLATFORM "android_mips"
60 #elif defined(__x86_64)
61 #define DTOOL_PLATFORM "android_amd64"
62 #elif defined(__i386__)
63 #define DTOOL_PLATFORM "android_i386"
64 #endif
65 
66 #elif defined(__aarch64__)
67 #define DTOOL_PLATFORM "linux_aarch64"
68 
69 #elif defined(__x86_64)
70 #define DTOOL_PLATFORM "linux_amd64"
71 
72 #elif defined(__i386)
73 #define DTOOL_PLATFORM "linux_i386"
74 
75 #elif defined(__arm__)
76 #define DTOOL_PLATFORM "linux_arm"
77 
78 #elif defined(__ppc__)
79 #define DTOOL_PLATFORM "linux_ppc"
80 #endif
81 
82 #if !defined(DTOOL_PLATFORM) && !defined(CPPPARSER)
83 #error "Can't determine platform; please define DTOOL_PLATFORM in Config.pp file."
84 #endif
85 
86 #endif