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.

308 lines
9.6KB

  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. #if JUCE_MODULE_AVAILABLE_juce_opengl && defined (__IPHONE_12_0) && __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_12_0
  23. #define GLES_SILENCE_DEPRECATION 1
  24. #endif
  25. #import <Foundation/Foundation.h>
  26. #import <UIKit/UIKit.h>
  27. #import <CoreData/CoreData.h>
  28. #import <MobileCoreServices/MobileCoreServices.h>
  29. #include <sys/fcntl.h>
  30. #else
  31. #if JUCE_MODULE_AVAILABLE_juce_opengl && defined (MAC_OS_X_VERSION_10_14) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_14
  32. #define GL_SILENCE_DEPRECATION 1
  33. #endif
  34. #import <Cocoa/Cocoa.h>
  35. #if (! defined MAC_OS_X_VERSION_10_12) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12
  36. #define NSEventModifierFlagCommand NSCommandKeyMask
  37. #define NSEventModifierFlagControl NSControlKeyMask
  38. #define NSEventModifierFlagHelp NSHelpKeyMask
  39. #define NSEventModifierFlagNumericPad NSNumericPadKeyMask
  40. #define NSEventModifierFlagOption NSAlternateKeyMask
  41. #define NSEventModifierFlagShift NSShiftKeyMask
  42. #define NSCompositingOperationSourceOver NSCompositeSourceOver
  43. #define NSEventMaskApplicationDefined NSApplicationDefinedMask
  44. #define NSEventTypeApplicationDefined NSApplicationDefined
  45. #define NSEventTypeCursorUpdate NSCursorUpdate
  46. #define NSEventTypeMouseMoved NSMouseMoved
  47. #define NSEventTypeLeftMouseDown NSLeftMouseDown
  48. #define NSEventTypeRightMouseDown NSRightMouseDown
  49. #define NSEventTypeOtherMouseDown NSOtherMouseDown
  50. #define NSEventTypeLeftMouseUp NSLeftMouseUp
  51. #define NSEventTypeRightMouseUp NSRightMouseUp
  52. #define NSEventTypeOtherMouseUp NSOtherMouseUp
  53. #define NSEventTypeLeftMouseDragged NSLeftMouseDragged
  54. #define NSEventTypeRightMouseDragged NSRightMouseDragged
  55. #define NSEventTypeOtherMouseDragged NSOtherMouseDragged
  56. #define NSEventTypeScrollWheel NSScrollWheel
  57. #define NSEventTypeKeyDown NSKeyDown
  58. #define NSEventTypeKeyUp NSKeyUp
  59. #define NSEventTypeFlagsChanged NSFlagsChanged
  60. #define NSEventMaskAny NSAnyEventMask
  61. #define NSWindowStyleMaskBorderless NSBorderlessWindowMask
  62. #define NSWindowStyleMaskClosable NSClosableWindowMask
  63. #define NSWindowStyleMaskFullScreen NSFullScreenWindowMask
  64. #define NSWindowStyleMaskMiniaturizable NSMiniaturizableWindowMask
  65. #define NSWindowStyleMaskResizable NSResizableWindowMask
  66. #define NSWindowStyleMaskTitled NSTitledWindowMask
  67. #define NSAlertStyleCritical NSCriticalAlertStyle
  68. #define NSControlSizeRegular NSRegularControlSize
  69. #define NSEventTypeMouseEntered NSMouseEntered
  70. #define NSEventTypeMouseExited NSMouseExited
  71. #define NSAlertStyleInformational NSInformationalAlertStyle
  72. #define NSEventTypeTabletPoint NSTabletPoint
  73. #define NSEventTypeTabletProximity NSTabletProximity
  74. #endif
  75. #import <CoreAudio/HostTime.h>
  76. #include <sys/dir.h>
  77. #endif
  78. #include <sys/socket.h>
  79. #include <sys/sysctl.h>
  80. #include <sys/stat.h>
  81. #include <sys/param.h>
  82. #include <sys/mount.h>
  83. #include <sys/utsname.h>
  84. #include <sys/mman.h>
  85. #include <fnmatch.h>
  86. #include <utime.h>
  87. #include <dlfcn.h>
  88. #include <ifaddrs.h>
  89. #include <net/if_dl.h>
  90. #include <mach/mach_time.h>
  91. #include <mach-o/dyld.h>
  92. #include <objc/runtime.h>
  93. #include <objc/objc.h>
  94. #include <objc/message.h>
  95. #include <poll.h>
  96. //==============================================================================
  97. #elif JUCE_WINDOWS
  98. #if JUCE_MSVC
  99. #ifndef _CPPRTTI
  100. #error "You're compiling without RTTI enabled! This is needed for a lot of JUCE classes, please update your compiler settings!"
  101. #endif
  102. #ifndef _CPPUNWIND
  103. #error "You're compiling without exceptions enabled! This is needed for a lot of JUCE classes, please update your compiler settings!"
  104. #endif
  105. #pragma warning (push, 0) // disable all warnings whilst including system headers
  106. #endif
  107. #define NOMINMAX
  108. #define _WINSOCK_DEPRECATED_NO_WARNINGS 1
  109. #define STRICT 1
  110. #define WIN32_LEAN_AND_MEAN 1
  111. #if JUCE_MINGW
  112. #define _WIN32_WINNT 0x0501
  113. #else
  114. #define _WIN32_WINNT 0x0602
  115. #endif
  116. #define _UNICODE 1
  117. #define UNICODE 1
  118. #ifndef _WIN32_IE
  119. #define _WIN32_IE 0x0500
  120. #endif
  121. #include <windows.h>
  122. #include <shellapi.h>
  123. #include <tchar.h>
  124. #include <stddef.h>
  125. #include <ctime>
  126. #include <wininet.h>
  127. #include <nb30.h>
  128. #include <winsock2.h>
  129. #include <ws2tcpip.h>
  130. #include <iphlpapi.h>
  131. #include <mapi.h>
  132. #include <float.h>
  133. #include <process.h>
  134. #include <shlobj.h>
  135. #include <shlwapi.h>
  136. #include <mmsystem.h>
  137. #include <winioctl.h>
  138. #if JUCE_MINGW
  139. #include <basetyps.h>
  140. #include <sys/time.h>
  141. #ifndef alloca
  142. #define alloca __builtin_alloca
  143. #endif
  144. #else
  145. #include <crtdbg.h>
  146. #include <comutil.h>
  147. #endif
  148. #ifndef S_FALSE
  149. #define S_FALSE (1) // (apparently some obscure win32 dev environments don't define this)
  150. #endif
  151. #undef PACKED
  152. #if JUCE_MSVC
  153. #pragma warning (pop)
  154. #pragma warning (4: 4511 4512 4100)
  155. #endif
  156. #if JUCE_MSVC && ! JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES
  157. #pragma comment (lib, "kernel32.lib")
  158. #pragma comment (lib, "user32.lib")
  159. #pragma comment (lib, "wininet.lib")
  160. #pragma comment (lib, "advapi32.lib")
  161. #pragma comment (lib, "ws2_32.lib")
  162. #pragma comment (lib, "version.lib")
  163. #pragma comment (lib, "shlwapi.lib")
  164. #pragma comment (lib, "winmm.lib")
  165. #ifdef _NATIVE_WCHAR_T_DEFINED
  166. #ifdef _DEBUG
  167. #pragma comment (lib, "comsuppwd.lib")
  168. #else
  169. #pragma comment (lib, "comsuppw.lib")
  170. #endif
  171. #else
  172. #ifdef _DEBUG
  173. #pragma comment (lib, "comsuppd.lib")
  174. #else
  175. #pragma comment (lib, "comsupp.lib")
  176. #endif
  177. #endif
  178. #endif
  179. /* Used with DynamicLibrary to simplify importing functions from a win32 DLL.
  180. dll: the DynamicLibrary object
  181. functionName: function to import
  182. localFunctionName: name you want to use to actually call it (must be different)
  183. returnType: the return type
  184. params: list of params (bracketed)
  185. */
  186. #define JUCE_LOAD_WINAPI_FUNCTION(dll, functionName, localFunctionName, returnType, params) \
  187. typedef returnType (WINAPI *type##localFunctionName) params; \
  188. type##localFunctionName localFunctionName = (type##localFunctionName) dll.getFunction (#functionName);
  189. //==============================================================================
  190. #elif JUCE_LINUX
  191. #include <arpa/inet.h>
  192. #include <dlfcn.h>
  193. #include <errno.h>
  194. #include <fcntl.h>
  195. #include <fnmatch.h>
  196. #include <net/if.h>
  197. #include <netdb.h>
  198. #include <netinet/in.h>
  199. #include <pthread.h>
  200. #include <pwd.h>
  201. #include <sched.h>
  202. #include <signal.h>
  203. #include <stddef.h>
  204. #include <sys/dir.h>
  205. #include <sys/file.h>
  206. #include <sys/ioctl.h>
  207. #include <sys/mman.h>
  208. #include <sys/prctl.h>
  209. #include <sys/ptrace.h>
  210. #include <sys/socket.h>
  211. #include <sys/stat.h>
  212. #include <sys/sysinfo.h>
  213. #include <sys/time.h>
  214. #include <sys/types.h>
  215. #include <sys/vfs.h>
  216. #include <sys/wait.h>
  217. #include <utime.h>
  218. #include <poll.h>
  219. //==============================================================================
  220. #elif JUCE_BSD
  221. #include <arpa/inet.h>
  222. #include <dirent.h>
  223. #include <dlfcn.h>
  224. #include <errno.h>
  225. #include <fcntl.h>
  226. #include <fnmatch.h>
  227. #include <net/if.h>
  228. #include <netdb.h>
  229. #include <netinet/in.h>
  230. #include <pthread.h>
  231. #include <pwd.h>
  232. #include <sched.h>
  233. #include <signal.h>
  234. #include <stddef.h>
  235. #include <sys/file.h>
  236. #include <sys/ioctl.h>
  237. #include <sys/mman.h>
  238. #include <sys/mount.h>
  239. #include <sys/ptrace.h>
  240. #include <sys/socket.h>
  241. #include <sys/stat.h>
  242. #include <sys/time.h>
  243. #include <sys/types.h>
  244. #include <sys/wait.h>
  245. #include <utime.h>
  246. #include <poll.h>
  247. //==============================================================================
  248. #elif JUCE_ANDROID
  249. #include <jni.h>
  250. #include <pthread.h>
  251. #include <sched.h>
  252. #include <sys/time.h>
  253. #include <utime.h>
  254. #include <errno.h>
  255. #include <fcntl.h>
  256. #include <dlfcn.h>
  257. #include <sys/stat.h>
  258. #include <sys/statfs.h>
  259. #include <sys/ptrace.h>
  260. #include <sys/sysinfo.h>
  261. #include <sys/mman.h>
  262. #include <pwd.h>
  263. #include <dirent.h>
  264. #include <fnmatch.h>
  265. #include <sys/wait.h>
  266. #include <android/api-level.h>
  267. #include <poll.h>
  268. // If you are getting include errors here, then you to re-build the Projucer
  269. // and re-save your .jucer file.
  270. #include <cpu-features.h>
  271. #endif
  272. // Need to clear various moronic redefinitions made by system headers..
  273. #undef max
  274. #undef min
  275. #undef direct
  276. #undef check