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.

199 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 18
  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. #include <malloc.h>
  83. #pragma warning (pop)
  84. #endif
  85. #if JUCE_ANDROID
  86. #include <sys/atomics.h>
  87. #include <byteswap.h>
  88. #endif
  89. //==============================================================================
  90. // DLL building settings on Windows
  91. #if JUCE_MSVC
  92. #ifdef JUCE_DLL_BUILD
  93. #define JUCE_API __declspec (dllexport)
  94. #pragma warning (disable: 4251)
  95. #elif defined (JUCE_DLL)
  96. #define JUCE_API __declspec (dllimport)
  97. #pragma warning (disable: 4251)
  98. #endif
  99. #ifdef __INTEL_COMPILER
  100. #pragma warning (disable: 1125) // (virtual override warning)
  101. #endif
  102. #elif defined (__GNUC__) && ((__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
  103. #ifdef JUCE_DLL_BUILD
  104. #define JUCE_API __attribute__ ((visibility("default")))
  105. #endif
  106. #endif
  107. #ifndef JUCE_API
  108. /** This macro is added to all juce public class declarations. */
  109. #define JUCE_API
  110. #endif
  111. /** This macro is added to all juce public function declarations. */
  112. #define JUCE_PUBLIC_FUNCTION JUCE_API JUCE_CALLTYPE
  113. /** This turns on some non-essential bits of code that should prevent old code from compiling
  114. in cases where method signatures have changed, etc.
  115. */
  116. #if (! defined (JUCE_CATCH_DEPRECATED_CODE_MISUSE)) && JUCE_DEBUG && ! DOXYGEN
  117. #define JUCE_CATCH_DEPRECATED_CODE_MISUSE 1
  118. #endif
  119. //==============================================================================
  120. // Now include some basics that are needed by most of the Juce classes...
  121. BEGIN_JUCE_NAMESPACE
  122. extern JUCE_API bool JUCE_CALLTYPE juce_isRunningUnderDebugger();
  123. #if JUCE_LOG_ASSERTIONS
  124. extern JUCE_API void logAssertion (const char* filename, int lineNum) noexcept;
  125. #endif
  126. #include "../memory/juce_Memory.h"
  127. #include "../maths/juce_MathsFunctions.h"
  128. #include "../memory/juce_ByteOrder.h"
  129. #include "../logging/juce_Logger.h"
  130. #include "../memory/juce_LeakedObjectDetector.h"
  131. // unbelievably, some system headers actually use macros to define these symbols:
  132. #undef check
  133. #undef TYPE_BOOL
  134. //==============================================================================
  135. #if JUCE_MAC || JUCE_IOS || DOXYGEN
  136. /** A handy C++ wrapper that creates and deletes an NSAutoreleasePool object using RAII.
  137. You should use the JUCE_AUTORELEASEPOOL macro to create a local auto-release pool on the stack.
  138. */
  139. class JUCE_API ScopedAutoReleasePool
  140. {
  141. public:
  142. ScopedAutoReleasePool();
  143. ~ScopedAutoReleasePool();
  144. private:
  145. void* pool;
  146. JUCE_DECLARE_NON_COPYABLE (ScopedAutoReleasePool);
  147. };
  148. /** A macro that can be used to easily declare a local ScopedAutoReleasePool object for RAII-based obj-C autoreleasing. */
  149. #define JUCE_AUTORELEASEPOOL const juce::ScopedAutoReleasePool JUCE_JOIN_MACRO (autoReleasePool_, __LINE__);
  150. #else
  151. #define JUCE_AUTORELEASEPOOL
  152. #endif
  153. END_JUCE_NAMESPACE
  154. #endif // __JUCE_STANDARDHEADER_JUCEHEADER__