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.

296 lines
9.2KB

  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 0x0501
  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. #include <winioctl.h>
  131. #if JUCE_MINGW
  132. #include <basetyps.h>
  133. #include <sys/time.h>
  134. #ifndef alloca
  135. #define alloca __builtin_alloca
  136. #endif
  137. #else
  138. #include <crtdbg.h>
  139. #include <comutil.h>
  140. #endif
  141. #ifndef S_FALSE
  142. #define S_FALSE (1) // (apparently some obscure win32 dev environments don't define this)
  143. #endif
  144. #undef PACKED
  145. #if JUCE_MSVC
  146. #pragma warning (pop)
  147. #pragma warning (4: 4511 4512 4100)
  148. #endif
  149. #if JUCE_MSVC && ! JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES
  150. #pragma comment (lib, "kernel32.lib")
  151. #pragma comment (lib, "user32.lib")
  152. #pragma comment (lib, "wininet.lib")
  153. #pragma comment (lib, "advapi32.lib")
  154. #pragma comment (lib, "ws2_32.lib")
  155. #pragma comment (lib, "version.lib")
  156. #pragma comment (lib, "shlwapi.lib")
  157. #pragma comment (lib, "winmm.lib")
  158. #ifdef _NATIVE_WCHAR_T_DEFINED
  159. #ifdef _DEBUG
  160. #pragma comment (lib, "comsuppwd.lib")
  161. #else
  162. #pragma comment (lib, "comsuppw.lib")
  163. #endif
  164. #else
  165. #ifdef _DEBUG
  166. #pragma comment (lib, "comsuppd.lib")
  167. #else
  168. #pragma comment (lib, "comsupp.lib")
  169. #endif
  170. #endif
  171. #endif
  172. /* Used with DynamicLibrary to simplify importing functions from a win32 DLL.
  173. dll: the DynamicLibrary object
  174. functionName: function to import
  175. localFunctionName: name you want to use to actually call it (must be different)
  176. returnType: the return type
  177. params: list of params (bracketed)
  178. */
  179. #define JUCE_LOAD_WINAPI_FUNCTION(dll, functionName, localFunctionName, returnType, params) \
  180. typedef returnType (WINAPI *type##localFunctionName) params; \
  181. type##localFunctionName localFunctionName = (type##localFunctionName) dll.getFunction (#functionName);
  182. //==============================================================================
  183. #elif JUCE_LINUX
  184. #include <arpa/inet.h>
  185. #include <dlfcn.h>
  186. #include <errno.h>
  187. #include <fcntl.h>
  188. #include <fnmatch.h>
  189. #include <net/if.h>
  190. #include <netdb.h>
  191. #include <netinet/in.h>
  192. #include <pthread.h>
  193. #include <pwd.h>
  194. #include <sched.h>
  195. #include <signal.h>
  196. #include <stddef.h>
  197. #include <sys/dir.h>
  198. #include <sys/file.h>
  199. #include <sys/ioctl.h>
  200. #include <sys/mman.h>
  201. #include <sys/prctl.h>
  202. #include <sys/ptrace.h>
  203. #include <sys/socket.h>
  204. #include <sys/stat.h>
  205. #include <sys/sysinfo.h>
  206. #include <sys/time.h>
  207. #include <sys/types.h>
  208. #include <sys/vfs.h>
  209. #include <sys/wait.h>
  210. #include <utime.h>
  211. //==============================================================================
  212. #elif JUCE_BSD
  213. #include <arpa/inet.h>
  214. #include <dirent.h>
  215. #include <dlfcn.h>
  216. #include <errno.h>
  217. #include <fcntl.h>
  218. #include <fnmatch.h>
  219. #include <net/if.h>
  220. #include <netdb.h>
  221. #include <netinet/in.h>
  222. #include <pthread.h>
  223. #include <pwd.h>
  224. #include <sched.h>
  225. #include <signal.h>
  226. #include <stddef.h>
  227. #include <sys/file.h>
  228. #include <sys/ioctl.h>
  229. #include <sys/mman.h>
  230. #include <sys/mount.h>
  231. #include <sys/ptrace.h>
  232. #include <sys/socket.h>
  233. #include <sys/stat.h>
  234. #include <sys/time.h>
  235. #include <sys/types.h>
  236. #include <sys/wait.h>
  237. #include <utime.h>
  238. //==============================================================================
  239. #elif JUCE_ANDROID
  240. #include <jni.h>
  241. #include <pthread.h>
  242. #include <sched.h>
  243. #include <sys/time.h>
  244. #include <utime.h>
  245. #include <errno.h>
  246. #include <fcntl.h>
  247. #include <dlfcn.h>
  248. #include <sys/stat.h>
  249. #include <sys/statfs.h>
  250. #include <sys/ptrace.h>
  251. #include <sys/sysinfo.h>
  252. #include <sys/mman.h>
  253. #include <pwd.h>
  254. #include <dirent.h>
  255. #include <fnmatch.h>
  256. #include <sys/wait.h>
  257. #include <android/api-level.h>
  258. // If you are getting include errors here, then you to re-build the Projucer
  259. // and re-save your .jucer file.
  260. #include <cpu-features.h>
  261. #endif
  262. // Need to clear various moronic redefinitions made by system headers..
  263. #undef max
  264. #undef min
  265. #undef direct
  266. #undef check