Add remaining files
[juce-lv2.git] / juce / source / src / core / juce_StandardHeader.h
bloba9212a5be59fc783702011065f0c2e26c0fac33c
1 /*
2 ==============================================================================
4 This file is part of the JUCE library - "Jules' Utility Class Extensions"
5 Copyright 2004-11 by Raw Material Software Ltd.
7 ------------------------------------------------------------------------------
9 JUCE can be redistributed and/or modified under the terms of the GNU General
10 Public License (Version 2), as published by the Free Software Foundation.
11 A copy of the license is included in the JUCE distribution, or can be found
12 online at www.gnu.org/licenses.
14 JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
15 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16 A PARTICULAR PURPOSE. See the GNU General Public License for more details.
18 ------------------------------------------------------------------------------
20 To release a closed-source product which uses JUCE, commercial licenses are
21 available: visit www.rawmaterialsoftware.com/juce for more information.
23 ==============================================================================
26 #ifndef __JUCE_STANDARDHEADER_JUCEHEADER__
27 #define __JUCE_STANDARDHEADER_JUCEHEADER__
29 //==============================================================================
30 /** Current Juce version number.
32 See also SystemStats::getJUCEVersion() for a string version.
34 #define JUCE_MAJOR_VERSION 1
35 #define JUCE_MINOR_VERSION 53
36 #define JUCE_BUILDNUMBER 107
38 /** Current Juce version number.
40 Bits 16 to 32 = major version.
41 Bits 8 to 16 = minor version.
42 Bits 0 to 8 = point release (not currently used).
44 See also SystemStats::getJUCEVersion() for a string version.
46 #define JUCE_VERSION ((JUCE_MAJOR_VERSION << 16) + (JUCE_MINOR_VERSION << 8) + JUCE_BUILDNUMBER)
49 //==============================================================================
50 #include "juce_TargetPlatform.h" // (sets up the various JUCE_WINDOWS, JUCE_MAC, etc flags)
52 #include "../../juce_Config.h"
54 //==============================================================================
55 #ifdef JUCE_NAMESPACE
56 #define BEGIN_JUCE_NAMESPACE namespace JUCE_NAMESPACE {
57 #define END_JUCE_NAMESPACE }
58 #else
59 #define BEGIN_JUCE_NAMESPACE
60 #define END_JUCE_NAMESPACE
61 #endif
63 //==============================================================================
64 #include "juce_PlatformDefs.h"
66 // Now we'll include any OS headers we need.. (at this point we are outside the Juce namespace).
67 #if JUCE_MSVC
68 #if JUCE_VC6
69 #pragma warning (disable: 4284 4786) // (spurious VC6 warnings)
71 namespace std // VC6 doesn't have sqrt/sin/cos/tan/abs in std, so declare them here:
73 template <typename Type> Type abs (Type a) { if (a < 0) return -a; return a; }
74 template <typename Type> Type tan (Type a) { return static_cast<Type> (::tan (static_cast<double> (a))); }
75 template <typename Type> Type sin (Type a) { return static_cast<Type> (::sin (static_cast<double> (a))); }
76 template <typename Type> Type cos (Type a) { return static_cast<Type> (::cos (static_cast<double> (a))); }
77 template <typename Type> Type sqrt (Type a) { return static_cast<Type> (::sqrt (static_cast<double> (a))); }
78 template <typename Type> Type floor (Type a) { return static_cast<Type> (::floor (static_cast<double> (a))); }
79 template <typename Type> Type ceil (Type a) { return static_cast<Type> (::ceil (static_cast<double> (a))); }
80 template <typename Type> Type atan2 (Type a, Type b) { return static_cast<Type> (::atan2 (static_cast<double> (a), static_cast<double> (b))); }
82 #endif
84 #pragma warning (push)
85 #pragma warning (disable: 4514 4245 4100)
86 #endif
88 #include <cstdlib>
89 #include <cstdarg>
90 #include <climits>
91 #include <limits>
92 #include <cmath>
93 #include <cwchar>
94 #include <stdexcept>
95 #include <typeinfo>
96 #include <cstring>
97 #include <cstdio>
98 #include <iostream>
99 #include <vector>
101 #if JUCE_USE_INTRINSICS
102 #include <intrin.h>
103 #endif
105 #if JUCE_MAC || JUCE_IOS
106 #include <libkern/OSAtomic.h>
107 #endif
109 #if JUCE_LINUX
110 #include <signal.h>
112 #if __INTEL_COMPILER
113 #if __ia64__
114 #include <ia64intrin.h>
115 #else
116 #include <ia32intrin.h>
117 #endif
118 #endif
119 #endif
121 #if JUCE_MSVC && JUCE_DEBUG
122 #include <crtdbg.h>
123 #endif
125 #if JUCE_MSVC
126 #include <malloc.h>
127 #pragma warning (pop)
129 #if ! JUCE_PUBLIC_INCLUDES
130 #pragma warning (4: 4511 4512 4100) // (enable some warnings that are turned off in VC8)
131 #endif
132 #endif
134 #if JUCE_ANDROID
135 #include <sys/atomics.h>
136 #include <byteswap.h>
137 #endif
139 //==============================================================================
140 // DLL building settings on Win32
141 #if JUCE_MSVC
142 #ifdef JUCE_DLL_BUILD
143 #define JUCE_API __declspec (dllexport)
144 #pragma warning (disable: 4251)
145 #elif defined (JUCE_DLL)
146 #define JUCE_API __declspec (dllimport)
147 #pragma warning (disable: 4251)
148 #endif
149 #ifdef __INTEL_COMPILER
150 #pragma warning (disable: 1125) // (virtual override warning)
151 #endif
152 #elif defined (__GNUC__) && ((__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
153 #ifdef JUCE_DLL_BUILD
154 #define JUCE_API __attribute__ ((visibility("default")))
155 #endif
156 #endif
158 #ifndef JUCE_API
159 /** This macro is added to all juce public class declarations. */
160 #define JUCE_API
161 #endif
163 /** This macro is added to all juce public function declarations. */
164 #define JUCE_PUBLIC_FUNCTION JUCE_API JUCE_CALLTYPE
166 /** This turns on some non-essential bits of code that should prevent old code from compiling
167 in cases where method signatures have changed, etc.
169 #if (! defined (JUCE_CATCH_DEPRECATED_CODE_MISUSE)) && JUCE_DEBUG && ! DOXYGEN
170 #define JUCE_CATCH_DEPRECATED_CODE_MISUSE 1
171 #endif
173 //==============================================================================
174 // Now include some basics that are needed by most of the Juce classes...
175 BEGIN_JUCE_NAMESPACE
177 extern JUCE_API bool JUCE_CALLTYPE juce_isRunningUnderDebugger();
179 #if JUCE_LOG_ASSERTIONS
180 extern JUCE_API void juce_LogAssertion (const char* filename, int lineNum) noexcept;
181 #endif
183 #include "../memory/juce_Memory.h"
184 #include "../maths/juce_MathsFunctions.h"
185 #include "../memory/juce_ByteOrder.h"
186 #include "juce_Logger.h"
187 #include "../memory/juce_LeakedObjectDetector.h"
189 #undef TYPE_BOOL // (stupidly-named CoreServices definition which interferes with other libraries).
191 END_JUCE_NAMESPACE
194 #endif // __JUCE_STANDARDHEADER_JUCEHEADER__