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