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.

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