OpenShot Library | OpenShotAudio  0.2.1
juce_TargetPlatform.h
1 
2 /** @weakgroup juce_core-system
3  * @{
4  */
5 /*
6  ==============================================================================
7 
8  This file is part of the JUCE library.
9  Copyright (c) 2017 - ROLI Ltd.
10 
11  JUCE is an open source library subject to commercial or open-source
12  licensing.
13 
14  The code included in this file is provided under the terms of the ISC license
15  http://www.isc.org/downloads/software-support-policy/isc-license. Permission
16  To use, copy, modify, and/or distribute this software for any purpose with or
17  without fee is hereby granted provided that the above copyright notice and
18  this permission notice appear in all copies.
19 
20  JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
21  EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
22  DISCLAIMED.
23 
24  ==============================================================================
25 */
26 
27 #pragma once
28 
29 //==============================================================================
30 /* This file figures out which platform is being built, and defines some macros
31  that the rest of the code can use for OS-specific compilation.
32 
33  Macros that will be set here are:
34 
35  - One of JUCE_WINDOWS, JUCE_MAC JUCE_LINUX, JUCE_IOS, JUCE_ANDROID, etc.
36  - Either JUCE_32BIT or JUCE_64BIT, depending on the architecture.
37  - Either JUCE_LITTLE_ENDIAN or JUCE_BIG_ENDIAN.
38  - Either JUCE_INTEL or JUCE_ARM
39  - Either JUCE_GCC or JUCE_CLANG or JUCE_MSVC
40 */
41 
42 //==============================================================================
43 #ifdef JUCE_APP_CONFIG_HEADER
44  #include JUCE_APP_CONFIG_HEADER
45 #elif ! defined (JUCE_GLOBAL_MODULE_SETTINGS_INCLUDED)
46  /*
47  Most projects will contain a global header file containing various settings that
48  should be applied to all the code in your project. If you use the projucer, it'll
49  set up a global header file for you automatically, but if you're doing things manually,
50  you may want to set the JUCE_APP_CONFIG_HEADER macro with the name of a file to include,
51  or just include one before all the module cpp files, in which you set
52  JUCE_GLOBAL_MODULE_SETTINGS_INCLUDED=1 to silence this error.
53  (Or if you don't need a global header, then you can just define JUCE_GLOBAL_MODULE_SETTINGS_INCLUDED
54  globally to avoid this error).
55 
56  Note for people who hit this error when trying to compile a JUCE project created by
57  a pre-v4.2 version of the Introjucer/Projucer, it's very easy to fix: just re-save
58  your project with the latest version of the Projucer, and it'll magically fix this!
59  */
60  #error "No global header file was included!"
61 #endif
62 
63 //==============================================================================
64 #if defined (_WIN32) || defined (_WIN64)
65  #define JUCE_WIN32 1
66  #define JUCE_WINDOWS 1
67 #elif defined (JUCE_ANDROID)
68  #undef JUCE_ANDROID
69  #define JUCE_ANDROID 1
70 #elif defined (__FreeBSD__) || (__OpenBSD__)
71  #define JUCE_BSD 1
72 #elif defined (LINUX) || defined (__linux__)
73  #define JUCE_LINUX 1
74 #elif defined (__APPLE_CPP__) || defined (__APPLE_CC__)
75  #define CF_EXCLUDE_CSTD_HEADERS 1
76  #include <CoreFoundation/CoreFoundation.h> // (needed to find out what platform we're using)
77  #include "../native/juce_mac_ClangBugWorkaround.h"
78 
79  #if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
80  #define JUCE_IPHONE 1
81  #define JUCE_IOS 1
82  #else
83  #define JUCE_MAC 1
84  #endif
85 #else
86  #error "Unknown platform!"
87 #endif
88 
89 //==============================================================================
90 #if JUCE_WINDOWS
91  #ifdef _MSC_VER
92  #ifdef _WIN64
93  #define JUCE_64BIT 1
94  #else
95  #define JUCE_32BIT 1
96  #endif
97  #endif
98 
99  #ifdef _DEBUG
100  #define JUCE_DEBUG 1
101  #endif
102 
103  #ifdef __MINGW32__
104  #define JUCE_MINGW 1
105  #ifdef __MINGW64__
106  #define JUCE_64BIT 1
107  #else
108  #define JUCE_32BIT 1
109  #endif
110  #endif
111 
112  /** If defined, this indicates that the processor is little-endian. */
113  #define JUCE_LITTLE_ENDIAN 1
114 
115  #define JUCE_INTEL 1
116 #endif
117 
118 //==============================================================================
119 #if JUCE_MAC || JUCE_IOS
120 
121  #if defined (DEBUG) || defined (_DEBUG) || ! (defined (NDEBUG) || defined (_NDEBUG))
122  #define JUCE_DEBUG 1
123  #endif
124 
125  #if ! (defined (DEBUG) || defined (_DEBUG) || defined (NDEBUG) || defined (_NDEBUG))
126  #warning "Neither NDEBUG or DEBUG has been defined - you should set one of these to make it clear whether this is a release build,"
127  #endif
128 
129  #ifdef __LITTLE_ENDIAN__
130  #define JUCE_LITTLE_ENDIAN 1
131  #else
132  #define JUCE_BIG_ENDIAN 1
133  #endif
134 
135  #ifdef __LP64__
136  #define JUCE_64BIT 1
137  #else
138  #define JUCE_32BIT 1
139  #endif
140 
141  #if defined (__ppc__) || defined (__ppc64__)
142  #error "PowerPC is no longer supported by JUCE!"
143  #elif defined (__arm__) || defined (__arm64__)
144  #define JUCE_ARM 1
145  #else
146  #define JUCE_INTEL 1
147  #endif
148 
149  #if JUCE_MAC
150  #if ! defined (MAC_OS_X_VERSION_10_11)
151  #error "The 10.11 SDK (Xcode 7.3.1+) is required to build JUCE apps. You can create apps that run on macOS 10.7+ by changing the deployment target."
152  #elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_7
153  #error "Building for OSX 10.6 is no longer supported!"
154  #endif
155  #endif
156 #endif
157 
158 //==============================================================================
159 #if JUCE_LINUX || JUCE_ANDROID
160 
161  #ifdef _DEBUG
162  #define JUCE_DEBUG 1
163  #endif
164 
165  // Allow override for big-endian Linux platforms
166  #if defined (__LITTLE_ENDIAN__) || ! defined (JUCE_BIG_ENDIAN)
167  #define JUCE_LITTLE_ENDIAN 1
168  #undef JUCE_BIG_ENDIAN
169  #else
170  #undef JUCE_LITTLE_ENDIAN
171  #define JUCE_BIG_ENDIAN 1
172  #endif
173 
174  #if defined (__LP64__) || defined (_LP64) || defined (__arm64__)
175  #define JUCE_64BIT 1
176  #else
177  #define JUCE_32BIT 1
178  #endif
179 
180  #if defined (__arm__) || defined (__arm64__) || defined (__aarch64__)
181  #define JUCE_ARM 1
182  #elif __MMX__ || __SSE__ || __amd64__
183  #define JUCE_INTEL 1
184  #endif
185 #endif
186 
187 //==============================================================================
188 // Compiler type macros.
189 
190 #if defined (__clang__)
191  #define JUCE_CLANG 1
192 
193 #elif defined (__GNUC__)
194  #define JUCE_GCC 1
195 
196 #elif defined (_MSC_VER)
197  #define JUCE_MSVC 1
198 
199 #else
200  #error unknown compiler
201 #endif
202 
203 /** @}*/