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.

267 lines
8.5KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2017 - ROLI Ltd.
  5. JUCE is an open source library subject to commercial or open-source
  6. licensing.
  7. The code included in this file is provided under the terms of the ISC license
  8. http://www.isc.org/downloads/software-support-policy/isc-license. Permission
  9. To use, copy, modify, and/or distribute this software for any purpose with or
  10. without fee is hereby granted provided that the above copyright notice and
  11. this permission notice appear in all copies.
  12. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  13. EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  14. DISCLAIMED.
  15. ==============================================================================
  16. */
  17. #pragma once
  18. #undef T
  19. //==============================================================================
  20. #if JUCE_MAC || JUCE_IOS
  21. #if JUCE_IOS
  22. #import <Foundation/Foundation.h>
  23. #import <UIKit/UIKit.h>
  24. #import <CoreData/CoreData.h>
  25. #import <MobileCoreServices/MobileCoreServices.h>
  26. #include <sys/fcntl.h>
  27. #else
  28. #import <Cocoa/Cocoa.h>
  29. #if (! defined MAC_OS_X_VERSION_10_12) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12
  30. #define NSEventModifierFlagCommand NSCommandKeyMask
  31. #define NSEventModifierFlagControl NSControlKeyMask
  32. #define NSEventModifierFlagHelp NSHelpKeyMask
  33. #define NSEventModifierFlagNumericPad NSNumericPadKeyMask
  34. #define NSEventModifierFlagOption NSAlternateKeyMask
  35. #define NSEventModifierFlagShift NSShiftKeyMask
  36. #define NSCompositingOperationSourceOver NSCompositeSourceOver
  37. #define NSEventMaskApplicationDefined NSApplicationDefinedMask
  38. #define NSEventTypeApplicationDefined NSApplicationDefined
  39. #define NSEventTypeCursorUpdate NSCursorUpdate
  40. #define NSEventTypeMouseMoved NSMouseMoved
  41. #define NSEventTypeLeftMouseDown NSLeftMouseDown
  42. #define NSEventTypeRightMouseDown NSRightMouseDown
  43. #define NSEventTypeOtherMouseDown NSOtherMouseDown
  44. #define NSEventTypeLeftMouseUp NSLeftMouseUp
  45. #define NSEventTypeRightMouseUp NSRightMouseUp
  46. #define NSEventTypeOtherMouseUp NSOtherMouseUp
  47. #define NSEventTypeLeftMouseDragged NSLeftMouseDragged
  48. #define NSEventTypeRightMouseDragged NSRightMouseDragged
  49. #define NSEventTypeOtherMouseDragged NSOtherMouseDragged
  50. #define NSEventTypeScrollWheel NSScrollWheel
  51. #define NSEventTypeKeyDown NSKeyDown
  52. #define NSEventTypeKeyUp NSKeyUp
  53. #define NSEventTypeFlagsChanged NSFlagsChanged
  54. #define NSEventMaskAny NSAnyEventMask
  55. #define NSWindowStyleMaskBorderless NSBorderlessWindowMask
  56. #define NSWindowStyleMaskClosable NSClosableWindowMask
  57. #define NSWindowStyleMaskFullScreen NSFullScreenWindowMask
  58. #define NSWindowStyleMaskMiniaturizable NSMiniaturizableWindowMask
  59. #define NSWindowStyleMaskResizable NSResizableWindowMask
  60. #define NSWindowStyleMaskTitled NSTitledWindowMask
  61. #define NSAlertStyleCritical NSCriticalAlertStyle
  62. #define NSControlSizeRegular NSRegularControlSize
  63. #define NSEventTypeMouseEntered NSMouseEntered
  64. #define NSEventTypeMouseExited NSMouseExited
  65. #define NSAlertStyleInformational NSInformationalAlertStyle
  66. #define NSEventTypeTabletPoint NSTabletPoint
  67. #define NSEventTypeTabletProximity NSTabletProximity
  68. #endif
  69. #import <CoreAudio/HostTime.h>
  70. #include <sys/dir.h>
  71. #endif
  72. #include <sys/socket.h>
  73. #include <sys/sysctl.h>
  74. #include <sys/stat.h>
  75. #include <sys/param.h>
  76. #include <sys/mount.h>
  77. #include <sys/utsname.h>
  78. #include <sys/mman.h>
  79. #include <fnmatch.h>
  80. #include <utime.h>
  81. #include <dlfcn.h>
  82. #include <ifaddrs.h>
  83. #include <net/if_dl.h>
  84. #include <mach/mach_time.h>
  85. #include <mach-o/dyld.h>
  86. #include <objc/runtime.h>
  87. #include <objc/objc.h>
  88. #include <objc/message.h>
  89. //==============================================================================
  90. #elif JUCE_WINDOWS
  91. #if JUCE_MSVC
  92. #ifndef _CPPRTTI
  93. #error "You're compiling without RTTI enabled! This is needed for a lot of JUCE classes, please update your compiler settings!"
  94. #endif
  95. #ifndef _CPPUNWIND
  96. #error "You're compiling without exceptions enabled! This is needed for a lot of JUCE classes, please update your compiler settings!"
  97. #endif
  98. #pragma warning (push, 0) // disable all warnings whilst including system headers
  99. #endif
  100. #define NOMINMAX
  101. #define _WINSOCK_DEPRECATED_NO_WARNINGS 1
  102. #define STRICT 1
  103. #define WIN32_LEAN_AND_MEAN 1
  104. #if JUCE_MINGW
  105. #define _WIN32_WINNT 0x0502
  106. #else
  107. #define _WIN32_WINNT 0x0602
  108. #endif
  109. #define _UNICODE 1
  110. #define UNICODE 1
  111. #ifndef _WIN32_IE
  112. #define _WIN32_IE 0x0500
  113. #endif
  114. #include <windows.h>
  115. #include <shellapi.h>
  116. #include <tchar.h>
  117. #include <stddef.h>
  118. #include <ctime>
  119. #include <wininet.h>
  120. #include <nb30.h>
  121. #include <winsock2.h>
  122. #include <ws2tcpip.h>
  123. #include <iphlpapi.h>
  124. #include <mapi.h>
  125. #include <float.h>
  126. #include <process.h>
  127. #include <shlobj.h>
  128. #include <shlwapi.h>
  129. #include <mmsystem.h>
  130. #if JUCE_MINGW
  131. #include <basetyps.h>
  132. #include <sys/time.h>
  133. #ifndef alloca
  134. #define alloca __builtin_alloca
  135. #endif
  136. #else
  137. #include <crtdbg.h>
  138. #include <comutil.h>
  139. #endif
  140. #ifndef S_FALSE
  141. #define S_FALSE (1) // (apparently some obscure win32 dev environments don't define this)
  142. #endif
  143. #undef PACKED
  144. #if JUCE_MSVC
  145. #pragma warning (pop)
  146. #pragma warning (4: 4511 4512 4100)
  147. #endif
  148. #if JUCE_MSVC && ! JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES
  149. #pragma comment (lib, "kernel32.lib")
  150. #pragma comment (lib, "user32.lib")
  151. #pragma comment (lib, "wininet.lib")
  152. #pragma comment (lib, "advapi32.lib")
  153. #pragma comment (lib, "ws2_32.lib")
  154. #pragma comment (lib, "version.lib")
  155. #pragma comment (lib, "shlwapi.lib")
  156. #pragma comment (lib, "winmm.lib")
  157. #ifdef _NATIVE_WCHAR_T_DEFINED
  158. #ifdef _DEBUG
  159. #pragma comment (lib, "comsuppwd.lib")
  160. #else
  161. #pragma comment (lib, "comsuppw.lib")
  162. #endif
  163. #else
  164. #ifdef _DEBUG
  165. #pragma comment (lib, "comsuppd.lib")
  166. #else
  167. #pragma comment (lib, "comsupp.lib")
  168. #endif
  169. #endif
  170. #endif
  171. /* Used with DynamicLibrary to simplify importing functions from a win32 DLL.
  172. dll: the DynamicLibrary object
  173. functionName: function to import
  174. localFunctionName: name you want to use to actually call it (must be different)
  175. returnType: the return type
  176. params: list of params (bracketed)
  177. */
  178. #define JUCE_LOAD_WINAPI_FUNCTION(dll, functionName, localFunctionName, returnType, params) \
  179. typedef returnType (WINAPI *type##localFunctionName) params; \
  180. type##localFunctionName localFunctionName = (type##localFunctionName) dll.getFunction (#functionName);
  181. //==============================================================================
  182. #elif JUCE_LINUX
  183. #include <sched.h>
  184. #include <pthread.h>
  185. #include <sys/time.h>
  186. #include <errno.h>
  187. #include <sys/stat.h>
  188. #include <sys/dir.h>
  189. #include <sys/ptrace.h>
  190. #include <sys/vfs.h>
  191. #include <sys/wait.h>
  192. #include <sys/mman.h>
  193. #include <fnmatch.h>
  194. #include <utime.h>
  195. #include <pwd.h>
  196. #include <fcntl.h>
  197. #include <dlfcn.h>
  198. #include <netdb.h>
  199. #include <arpa/inet.h>
  200. #include <netinet/in.h>
  201. #include <sys/types.h>
  202. #include <sys/ioctl.h>
  203. #include <sys/socket.h>
  204. #include <net/if.h>
  205. #include <sys/sysinfo.h>
  206. #include <sys/file.h>
  207. #include <sys/prctl.h>
  208. #include <signal.h>
  209. #include <stddef.h>
  210. //==============================================================================
  211. #elif JUCE_ANDROID
  212. #include <jni.h>
  213. #include <pthread.h>
  214. #include <sched.h>
  215. #include <sys/time.h>
  216. #include <utime.h>
  217. #include <errno.h>
  218. #include <fcntl.h>
  219. #include <dlfcn.h>
  220. #include <sys/stat.h>
  221. #include <sys/statfs.h>
  222. #include <sys/ptrace.h>
  223. #include <sys/sysinfo.h>
  224. #include <sys/mman.h>
  225. #include <pwd.h>
  226. #include <dirent.h>
  227. #include <fnmatch.h>
  228. #include <sys/wait.h>
  229. #include <android/api-level.h>
  230. // If you are getting include errors here, then you to re-build the Projucer
  231. // and re-save your .jucer file.
  232. #include <cpu-features.h>
  233. #endif
  234. // Need to clear various moronic redefinitions made by system headers..
  235. #undef max
  236. #undef min
  237. #undef direct
  238. #undef check