Panda3D

Loading...
Searching...
No Matches
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#elif defined(__aarch64__)
43#define DTOOL_PLATFORM "osx_aarch64"
44#endif
45
46#elif defined(__FreeBSD__)
47#if defined(__x86_64)
48#define DTOOL_PLATFORM "freebsd_amd64"
49#elif defined(__i386__)
50#define DTOOL_PLATFORM "freebsd_i386"
51#endif
52
53#elif defined(__ANDROID__)
54#if defined(__ARM_ARCH_7A__)
55#define DTOOL_PLATFORM "android_armv7a"
56#elif defined(__aarch64__)
57#define DTOOL_PLATFORM "android_aarch64"
58#elif defined(__arm__)
59#define DTOOL_PLATFORM "android_arm"
60#elif defined(__mips__)
61#define DTOOL_PLATFORM "android_mips"
62#elif defined(__x86_64)
63#define DTOOL_PLATFORM "android_amd64"
64#elif defined(__i386__)
65#define DTOOL_PLATFORM "android_i386"
66#endif
67
68#elif defined(__aarch64__)
69#define DTOOL_PLATFORM "linux_aarch64"
70
71#elif defined(__x86_64)
72#define DTOOL_PLATFORM "linux_amd64"
73
74#elif defined(__i386)
75#define DTOOL_PLATFORM "linux_i386"
76
77#elif defined(__arm__)
78#define DTOOL_PLATFORM "linux_arm"
79
80#elif defined(__ppc__)
81#define DTOOL_PLATFORM "linux_ppc"
82
83#elif defined(__e2k__)
84#define DTOOL_PLATFORM "linux_e2k"
85#endif
86
87#if !defined(DTOOL_PLATFORM) && !defined(CPPPARSER)
88#error "Can't determine platform; please define DTOOL_PLATFORM in Config.pp file."
89#endif
90
91#endif