openshot-audio  0.1.5
juce_TargetPlatform.h
Go to the documentation of this file.
1 /*
2  ==============================================================================
3 
4  This file is part of the juce_core module of the JUCE library.
5  Copyright (c) 2015 - ROLI Ltd.
6 
7  Permission to use, copy, modify, and/or distribute this software for any purpose with
8  or without fee is hereby granted, provided that the above copyright notice and this
9  permission notice appear in all copies.
10 
11  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
12  TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN
13  NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
15  IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
16  CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 
18  ------------------------------------------------------------------------------
19 
20  NOTE! This permissive ISC license applies ONLY to files within the juce_core module!
21  All other JUCE modules are covered by a dual GPL/commercial license, so if you are
22  using any other modules, be sure to check that you also comply with their license.
23 
24  For more details, visit www.juce.com
25 
26  ==============================================================================
27 */
28 
29 #ifndef JUCE_TARGETPLATFORM_H_INCLUDED
30 #define JUCE_TARGETPLATFORM_H_INCLUDED
31 
32 //==============================================================================
33 /* This file figures out which platform is being built, and defines some macros
34  that the rest of the code can use for OS-specific compilation.
35 
36  Macros that will be set here are:
37 
38  - One of JUCE_WINDOWS, JUCE_MAC JUCE_LINUX, JUCE_IOS, JUCE_ANDROID, etc.
39  - Either JUCE_32BIT or JUCE_64BIT, depending on the architecture.
40  - Either JUCE_LITTLE_ENDIAN or JUCE_BIG_ENDIAN.
41  - Either JUCE_INTEL or JUCE_PPC
42  - Either JUCE_GCC or JUCE_MSVC
43 */
44 
45 //==============================================================================
46 #if (defined (_WIN32) || defined (_WIN64))
47  #define JUCE_WIN32 1
48  #define JUCE_WINDOWS 1
49 #elif defined (JUCE_ANDROID)
50  #undef JUCE_ANDROID
51  #define JUCE_ANDROID 1
52 #elif defined (LINUX) || defined (__linux__)
53  #define JUCE_LINUX 1
54 #elif defined (__APPLE_CPP__) || defined(__APPLE_CC__)
55  #define Point CarbonDummyPointName // (workaround to avoid definition of "Point" by old Carbon headers)
56  #define Component CarbonDummyCompName
57  #include <CoreFoundation/CoreFoundation.h> // (needed to find out what platform we're using)
58  #undef Point
59  #undef Component
60 
61  #if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
62  #define JUCE_IPHONE 1
63  #define JUCE_IOS 1
64  #else
65  #define JUCE_MAC 1
66  #endif
67 #elif defined (__FreeBSD__)
68  #define JUCE_BSD 1
69 #else
70  #error "Unknown platform!"
71 #endif
72 
73 //==============================================================================
74 #if JUCE_WINDOWS
75  #ifdef _MSC_VER
76  #ifdef _WIN64
77  #define JUCE_64BIT 1
78  #else
79  #define JUCE_32BIT 1
80  #endif
81  #endif
82 
83  #ifdef _DEBUG
84  #define JUCE_DEBUG 1
85  #endif
86 
87  #ifdef __MINGW32__
88  #define JUCE_MINGW 1
89  #ifdef __MINGW64__
90  #define JUCE_64BIT 1
91  #else
92  #define JUCE_32BIT 1
93  #endif
94  #endif
95 
97  #define JUCE_LITTLE_ENDIAN 1
98 
99  #define JUCE_INTEL 1
100 #endif
101 
102 //==============================================================================
103 #if JUCE_MAC || JUCE_IOS
104 
105  #if defined (DEBUG) || defined (_DEBUG) || ! (defined (NDEBUG) || defined (_NDEBUG))
106  #define JUCE_DEBUG 1
107  #endif
108 
109  #if ! (defined (DEBUG) || defined (_DEBUG) || defined (NDEBUG) || defined (_NDEBUG))
110  #warning "Neither NDEBUG or DEBUG has been defined - you should set one of these to make it clear whether this is a release build,"
111  #endif
112 
113  #ifdef __LITTLE_ENDIAN__
114  #define JUCE_LITTLE_ENDIAN 1
115  #else
116  #define JUCE_BIG_ENDIAN 1
117  #endif
118 
119  #ifdef __LP64__
120  #define JUCE_64BIT 1
121  #else
122  #define JUCE_32BIT 1
123  #endif
124 
125  #if defined (__ppc__) || defined (__ppc64__)
126  #define JUCE_PPC 1
127  #elif defined (__arm__) || defined (__arm64__)
128  #define JUCE_ARM 1
129  #else
130  #define JUCE_INTEL 1
131  #endif
132 
133  #if JUCE_MAC && MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_4
134  #error "Building for OSX 10.3 is no longer supported!"
135  #endif
136 
137  #if JUCE_MAC && ! defined (MAC_OS_X_VERSION_10_5)
138  #error "To build with 10.4 compatibility, use a 10.5 or 10.6 SDK and set the deployment target to 10.4"
139  #endif
140 #endif
141 
142 //==============================================================================
143 #if JUCE_LINUX || JUCE_ANDROID
144 
145  #ifdef _DEBUG
146  #define JUCE_DEBUG 1
147  #endif
148 
149  // Allow override for big-endian Linux platforms
150  #if defined (__LITTLE_ENDIAN__) || ! defined (JUCE_BIG_ENDIAN)
151  #define JUCE_LITTLE_ENDIAN 1
152  #undef JUCE_BIG_ENDIAN
153  #else
154  #undef JUCE_LITTLE_ENDIAN
155  #define JUCE_BIG_ENDIAN 1
156  #endif
157 
158  #if defined (__LP64__) || defined (_LP64) || defined (__arm64__)
159  #define JUCE_64BIT 1
160  #else
161  #define JUCE_32BIT 1
162  #endif
163 
164  #if defined (__arm__) || defined (__arm64__)
165  #define JUCE_ARM 1
166  #elif __MMX__ || __SSE__ || __amd64__
167  #define JUCE_INTEL 1
168  #endif
169 #endif
170 
171 //==============================================================================
172 // Compiler type macros.
173 
174 #ifdef __clang__
175  #define JUCE_CLANG 1
176  #define JUCE_GCC 1
177 #elif defined (__GNUC__)
178  #define JUCE_GCC 1
179 #elif defined (_MSC_VER)
180  #define JUCE_MSVC 1
181 
182  #if _MSC_VER < 1500
183  #define JUCE_VC8_OR_EARLIER 1
184 
185  #if _MSC_VER < 1400
186  #define JUCE_VC7_OR_EARLIER 1
187 
188  #if _MSC_VER < 1300
189  #warning "MSVC 6.0 is no longer supported!"
190  #endif
191  #endif
192  #endif
193 
194  #if JUCE_64BIT || ! JUCE_VC7_OR_EARLIER
195  #define JUCE_USE_MSVC_INTRINSICS 1
196  #endif
197 #else
198  #error unknown compiler
199 #endif
200 
201 #endif // JUCE_TARGETPLATFORM_H_INCLUDED