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.

337 lines
10KB

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