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.

213 lines
7.1KB

  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 2
  25. #define JUCE_MINOR_VERSION 0
  26. #define JUCE_BUILDNUMBER 6
  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.
  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. //==============================================================================
  37. #define JUCE_NAMESPACE juce
  38. #define BEGIN_JUCE_NAMESPACE namespace juce {
  39. #define END_JUCE_NAMESPACE }
  40. //==============================================================================
  41. #include "juce_PlatformDefs.h"
  42. // Now we'll include any OS headers we need.. (at this point we are outside the Juce namespace).
  43. #if JUCE_MSVC
  44. #if JUCE_VC6
  45. #pragma warning (disable: 4284 4786) // (spurious VC6 warnings)
  46. namespace std // VC6 doesn't have sqrt/sin/cos/tan/abs in std, so declare them here:
  47. {
  48. template <typename Type> Type abs (Type a) { if (a < 0) return -a; return a; }
  49. template <typename Type> Type tan (Type a) { return static_cast<Type> (::tan (static_cast<double> (a))); }
  50. template <typename Type> Type sin (Type a) { return static_cast<Type> (::sin (static_cast<double> (a))); }
  51. template <typename Type> Type cos (Type a) { return static_cast<Type> (::cos (static_cast<double> (a))); }
  52. template <typename Type> Type sqrt (Type a) { return static_cast<Type> (::sqrt (static_cast<double> (a))); }
  53. template <typename Type> Type floor (Type a) { return static_cast<Type> (::floor (static_cast<double> (a))); }
  54. template <typename Type> Type ceil (Type a) { return static_cast<Type> (::ceil (static_cast<double> (a))); }
  55. template <typename Type> Type atan2 (Type a, Type b) { return static_cast<Type> (::atan2 (static_cast<double> (a), static_cast<double> (b))); }
  56. }
  57. #endif
  58. #pragma warning (push)
  59. #pragma warning (disable: 4514 4245 4100)
  60. #endif
  61. #include <cstdlib>
  62. #include <cstdarg>
  63. #include <climits>
  64. #include <limits>
  65. #include <cmath>
  66. #include <cwchar>
  67. #include <stdexcept>
  68. #include <typeinfo>
  69. #include <cstring>
  70. #include <cstdio>
  71. #include <iostream>
  72. #include <vector>
  73. #if JUCE_USE_INTRINSICS
  74. #include <intrin.h>
  75. #endif
  76. #if JUCE_MAC || JUCE_IOS
  77. #include <libkern/OSAtomic.h>
  78. #endif
  79. #if JUCE_LINUX
  80. #include <signal.h>
  81. #if __INTEL_COMPILER
  82. #if __ia64__
  83. #include <ia64intrin.h>
  84. #else
  85. #include <ia32intrin.h>
  86. #endif
  87. #endif
  88. #endif
  89. #if JUCE_MSVC && JUCE_DEBUG
  90. #include <crtdbg.h>
  91. #endif
  92. #if JUCE_MSVC
  93. #include <malloc.h>
  94. #pragma warning (pop)
  95. #endif
  96. #if JUCE_ANDROID
  97. #include <sys/atomics.h>
  98. #include <byteswap.h>
  99. #endif
  100. //==============================================================================
  101. // DLL building settings on Windows
  102. #if JUCE_MSVC
  103. #ifdef JUCE_DLL_BUILD
  104. #define JUCE_API __declspec (dllexport)
  105. #pragma warning (disable: 4251)
  106. #elif defined (JUCE_DLL)
  107. #define JUCE_API __declspec (dllimport)
  108. #pragma warning (disable: 4251)
  109. #endif
  110. #ifdef __INTEL_COMPILER
  111. #pragma warning (disable: 1125) // (virtual override warning)
  112. #endif
  113. #elif defined (__GNUC__) && ((__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
  114. #ifdef JUCE_DLL_BUILD
  115. #define JUCE_API __attribute__ ((visibility("default")))
  116. #endif
  117. #endif
  118. #ifndef JUCE_API
  119. /** This macro is added to all juce public class declarations. */
  120. #define JUCE_API
  121. #endif
  122. /** This macro is added to all juce public function declarations. */
  123. #define JUCE_PUBLIC_FUNCTION JUCE_API JUCE_CALLTYPE
  124. /** This turns on some non-essential bits of code that should prevent old code from compiling
  125. in cases where method signatures have changed, etc.
  126. */
  127. #if (! defined (JUCE_CATCH_DEPRECATED_CODE_MISUSE)) && JUCE_DEBUG && ! DOXYGEN
  128. #define JUCE_CATCH_DEPRECATED_CODE_MISUSE 1
  129. #endif
  130. //==============================================================================
  131. // Now include some basics that are needed by most of the Juce classes...
  132. BEGIN_JUCE_NAMESPACE
  133. extern JUCE_API bool JUCE_CALLTYPE juce_isRunningUnderDebugger();
  134. #if JUCE_LOG_ASSERTIONS
  135. extern JUCE_API void juce_LogAssertion (const char* filename, int lineNum) noexcept;
  136. #endif
  137. #include "../memory/juce_Memory.h"
  138. #include "../maths/juce_MathsFunctions.h"
  139. #include "../memory/juce_ByteOrder.h"
  140. #include "../logging/juce_Logger.h"
  141. #include "../memory/juce_LeakedObjectDetector.h"
  142. // unbelievably, some system headers actually use macros to define these symbols:
  143. #undef check
  144. #undef TYPE_BOOL
  145. //==============================================================================
  146. #if JUCE_MAC || JUCE_IOS || DOXYGEN
  147. /** A handy C++ wrapper that creates and deletes an NSAutoreleasePool object using RAII.
  148. You should use the JUCE_AUTORELEASEPOOL macro to create a local auto-release pool on the stack.
  149. */
  150. class JUCE_API ScopedAutoReleasePool
  151. {
  152. public:
  153. ScopedAutoReleasePool();
  154. ~ScopedAutoReleasePool();
  155. private:
  156. void* pool;
  157. JUCE_DECLARE_NON_COPYABLE (ScopedAutoReleasePool);
  158. };
  159. /** A macro that can be used to easily declare a local ScopedAutoReleasePool object for RAII-based obj-C autoreleasing. */
  160. #define JUCE_AUTORELEASEPOOL const juce::ScopedAutoReleasePool JUCE_JOIN_MACRO (autoReleasePool_, __LINE__);
  161. #else
  162. #define JUCE_AUTORELEASEPOOL
  163. #endif
  164. END_JUCE_NAMESPACE
  165. #endif // __JUCE_STANDARDHEADER_JUCEHEADER__