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.

319 lines
10KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2020 - Raw Material Software Limited
  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_MAX_ALLOWED >= __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. #define NSEventTypeFlagsChanged NSFlagsChanged
  75. #define NSEventTypeAppKitDefined NSAppKitDefined
  76. #define NSEventTypeSystemDefined NSSystemDefined
  77. #define NSEventTypeApplicationDefined NSApplicationDefined
  78. #define NSEventTypePeriodic NSPeriodic
  79. #define NSEventTypeSmartMagnify NSEventTypeSmartMagnify
  80. #endif
  81. #import <CoreAudio/HostTime.h>
  82. #include <sys/dir.h>
  83. #endif
  84. #include <sys/socket.h>
  85. #include <sys/sysctl.h>
  86. #include <sys/stat.h>
  87. #include <sys/param.h>
  88. #include <sys/mount.h>
  89. #include <sys/utsname.h>
  90. #include <sys/mman.h>
  91. #include <fnmatch.h>
  92. #include <utime.h>
  93. #include <dlfcn.h>
  94. #include <ifaddrs.h>
  95. #include <net/if_dl.h>
  96. #include <mach/mach_time.h>
  97. #include <mach-o/dyld.h>
  98. #include <objc/runtime.h>
  99. #include <objc/objc.h>
  100. #include <objc/message.h>
  101. #include <poll.h>
  102. //==============================================================================
  103. #elif JUCE_WINDOWS
  104. #if JUCE_MSVC
  105. #ifndef _CPPRTTI
  106. #error "You're compiling without RTTI enabled! This is needed for a lot of JUCE classes, please update your compiler settings!"
  107. #endif
  108. #ifndef _CPPUNWIND
  109. #error "You're compiling without exceptions enabled! This is needed for a lot of JUCE classes, please update your compiler settings!"
  110. #endif
  111. #pragma warning (push, 0) // disable all warnings whilst including system headers
  112. #endif
  113. #define NOMINMAX
  114. #define _WINSOCK_DEPRECATED_NO_WARNINGS 1
  115. #define STRICT 1
  116. #define WIN32_LEAN_AND_MEAN 1
  117. #if JUCE_MINGW
  118. #define _WIN32_WINNT 0x0600
  119. #else
  120. #define _WIN32_WINNT 0x0602
  121. #endif
  122. #define _UNICODE 1
  123. #define UNICODE 1
  124. #ifndef _WIN32_IE
  125. #define _WIN32_IE 0x0501
  126. #endif
  127. #include <windows.h>
  128. #include <shellapi.h>
  129. #include <tchar.h>
  130. #include <stddef.h>
  131. #include <ctime>
  132. #include <wininet.h>
  133. #include <nb30.h>
  134. #include <winsock2.h>
  135. #include <ws2tcpip.h>
  136. #include <iphlpapi.h>
  137. #include <mapi.h>
  138. #include <float.h>
  139. #include <process.h>
  140. #include <shlobj.h>
  141. #include <shlwapi.h>
  142. #include <mmsystem.h>
  143. #include <winioctl.h>
  144. #if JUCE_MINGW
  145. #include <basetyps.h>
  146. #include <sys/time.h>
  147. #ifndef alloca
  148. #define alloca __builtin_alloca
  149. #endif
  150. #else
  151. #include <crtdbg.h>
  152. #include <comutil.h>
  153. #endif
  154. #ifndef S_FALSE
  155. #define S_FALSE (1) // (apparently some obscure win32 dev environments don't define this)
  156. #endif
  157. #undef PACKED
  158. #if JUCE_MSVC
  159. #pragma warning (pop)
  160. #pragma warning (4: 4511 4512 4100)
  161. #endif
  162. #if ! JUCE_MINGW && ! JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES
  163. #pragma comment (lib, "kernel32.lib")
  164. #pragma comment (lib, "user32.lib")
  165. #pragma comment (lib, "wininet.lib")
  166. #pragma comment (lib, "advapi32.lib")
  167. #pragma comment (lib, "ws2_32.lib")
  168. #pragma comment (lib, "version.lib")
  169. #pragma comment (lib, "shlwapi.lib")
  170. #pragma comment (lib, "winmm.lib")
  171. #ifdef _NATIVE_WCHAR_T_DEFINED
  172. #ifdef _DEBUG
  173. #pragma comment (lib, "comsuppwd.lib")
  174. #else
  175. #pragma comment (lib, "comsuppw.lib")
  176. #endif
  177. #else
  178. #ifdef _DEBUG
  179. #pragma comment (lib, "comsuppd.lib")
  180. #else
  181. #pragma comment (lib, "comsupp.lib")
  182. #endif
  183. #endif
  184. #endif
  185. /* Used with DynamicLibrary to simplify importing functions from a win32 DLL.
  186. dll: the DynamicLibrary object
  187. functionName: function to import
  188. localFunctionName: name you want to use to actually call it (must be different)
  189. returnType: the return type
  190. params: list of params (bracketed)
  191. */
  192. #define JUCE_LOAD_WINAPI_FUNCTION(dll, functionName, localFunctionName, returnType, params) \
  193. typedef returnType (WINAPI *type##localFunctionName) params; \
  194. type##localFunctionName localFunctionName = (type##localFunctionName) dll.getFunction (#functionName);
  195. //==============================================================================
  196. #elif JUCE_LINUX
  197. #include <arpa/inet.h>
  198. #include <dlfcn.h>
  199. #include <errno.h>
  200. #include <fcntl.h>
  201. #include <fnmatch.h>
  202. #include <net/if.h>
  203. #include <netdb.h>
  204. #include <netinet/in.h>
  205. #include <pthread.h>
  206. #include <pwd.h>
  207. #include <sched.h>
  208. #include <signal.h>
  209. #include <stddef.h>
  210. #include <sys/dir.h>
  211. #include <sys/file.h>
  212. #include <sys/ioctl.h>
  213. #include <sys/mman.h>
  214. #include <sys/prctl.h>
  215. #include <sys/ptrace.h>
  216. #include <sys/socket.h>
  217. #include <sys/stat.h>
  218. #include <sys/sysinfo.h>
  219. #include <sys/time.h>
  220. #include <sys/types.h>
  221. #include <sys/vfs.h>
  222. #include <sys/wait.h>
  223. #include <utime.h>
  224. #include <poll.h>
  225. //==============================================================================
  226. #elif JUCE_BSD
  227. #include <arpa/inet.h>
  228. #include <dirent.h>
  229. #include <dlfcn.h>
  230. #include <errno.h>
  231. #include <fcntl.h>
  232. #include <fnmatch.h>
  233. #include <ifaddrs.h>
  234. #include <langinfo.h>
  235. #include <net/if.h>
  236. #include <net/if_dl.h>
  237. #include <netdb.h>
  238. #include <netinet/in.h>
  239. #include <pthread.h>
  240. #include <pwd.h>
  241. #include <sched.h>
  242. #include <signal.h>
  243. #include <stddef.h>
  244. #include <sys/file.h>
  245. #include <sys/ioctl.h>
  246. #include <sys/mman.h>
  247. #include <sys/mount.h>
  248. #include <sys/ptrace.h>
  249. #include <sys/socket.h>
  250. #include <sys/stat.h>
  251. #include <sys/sysctl.h>
  252. #include <sys/time.h>
  253. #include <sys/types.h>
  254. #include <sys/user.h>
  255. #include <sys/wait.h>
  256. #include <utime.h>
  257. #include <poll.h>
  258. //==============================================================================
  259. #elif JUCE_ANDROID
  260. #include <jni.h>
  261. #include <pthread.h>
  262. #include <sched.h>
  263. #include <sys/time.h>
  264. #include <utime.h>
  265. #include <errno.h>
  266. #include <fcntl.h>
  267. #include <dlfcn.h>
  268. #include <sys/stat.h>
  269. #include <sys/statfs.h>
  270. #include <sys/ptrace.h>
  271. #include <sys/sysinfo.h>
  272. #include <sys/mman.h>
  273. #include <pwd.h>
  274. #include <dirent.h>
  275. #include <fnmatch.h>
  276. #include <sys/wait.h>
  277. #include <android/api-level.h>
  278. #include <poll.h>
  279. // If you are getting include errors here, then you to re-build the Projucer
  280. // and re-save your .jucer file.
  281. #include <cpu-features.h>
  282. #endif
  283. // Need to clear various moronic redefinitions made by system headers..
  284. #undef max
  285. #undef min
  286. #undef direct
  287. #undef check