The JUCE cross-platform C++ framework, with DISTRHO/KXStudio specific changes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

217 lines
7.3KB

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