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