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.

201 lines
6.0KB

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