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.

285 lines
7.4KB

  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
  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
  34. #define GL_SILENCE_DEPRECATION 1
  35. #endif
  36. #import <Cocoa/Cocoa.h>
  37. #import <CoreAudio/HostTime.h>
  38. #include <sys/dir.h>
  39. #endif
  40. #include <sys/socket.h>
  41. #include <sys/sysctl.h>
  42. #include <sys/stat.h>
  43. #include <sys/param.h>
  44. #include <sys/mount.h>
  45. #include <sys/utsname.h>
  46. #include <sys/mman.h>
  47. #include <fnmatch.h>
  48. #include <utime.h>
  49. #include <dlfcn.h>
  50. #include <ifaddrs.h>
  51. #include <net/if_dl.h>
  52. #include <mach/mach_time.h>
  53. #include <mach-o/dyld.h>
  54. #include <objc/runtime.h>
  55. #include <objc/objc.h>
  56. #include <objc/message.h>
  57. #include <poll.h>
  58. //==============================================================================
  59. #elif JUCE_WINDOWS
  60. #if JUCE_MSVC
  61. #ifndef _CPPRTTI
  62. #error "You're compiling without RTTI enabled! This is needed for a lot of JUCE classes, please update your compiler settings!"
  63. #endif
  64. #ifndef _CPPUNWIND
  65. #error "You're compiling without exceptions enabled! This is needed for a lot of JUCE classes, please update your compiler settings!"
  66. #endif
  67. #pragma warning (push, 0) // disable all warnings whilst including system headers
  68. #endif
  69. #define NOMINMAX
  70. #define _WINSOCK_DEPRECATED_NO_WARNINGS 1
  71. #define STRICT 1
  72. #define WIN32_LEAN_AND_MEAN 1
  73. #if JUCE_MINGW
  74. #if ! defined (_WIN32_WINNT)
  75. #define _WIN32_WINNT 0x0600
  76. #endif
  77. #else
  78. #define _WIN32_WINNT 0x0602
  79. #endif
  80. #define _UNICODE 1
  81. #define UNICODE 1
  82. #ifndef _WIN32_IE
  83. #define _WIN32_IE 0x0501
  84. #endif
  85. #include <windows.h>
  86. #include <shellapi.h>
  87. #include <tchar.h>
  88. #include <stddef.h>
  89. #include <ctime>
  90. #include <wininet.h>
  91. #include <nb30.h>
  92. #include <winsock2.h>
  93. #include <ws2tcpip.h>
  94. #include <iphlpapi.h>
  95. #include <accctrl.h>
  96. #include <aclapi.h>
  97. #include <mapi.h>
  98. #include <float.h>
  99. #include <process.h>
  100. #include <shlobj.h>
  101. #include <shlwapi.h>
  102. #include <mmsystem.h>
  103. #include <winioctl.h>
  104. #if JUCE_MINGW
  105. #include <basetyps.h>
  106. #include <sys/time.h>
  107. #ifndef alloca
  108. #define alloca __builtin_alloca
  109. #endif
  110. #else
  111. #include <crtdbg.h>
  112. #include <comutil.h>
  113. #endif
  114. #ifndef S_FALSE
  115. #define S_FALSE (1) // (apparently some obscure win32 dev environments don't define this)
  116. #endif
  117. #undef PACKED
  118. #if JUCE_MSVC
  119. #pragma warning (pop)
  120. #pragma warning (4: 4511 4512 4100)
  121. #endif
  122. #if ! JUCE_MINGW && ! JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES
  123. #pragma comment (lib, "kernel32.lib")
  124. #pragma comment (lib, "user32.lib")
  125. #pragma comment (lib, "wininet.lib")
  126. #pragma comment (lib, "advapi32.lib")
  127. #pragma comment (lib, "ws2_32.lib")
  128. #pragma comment (lib, "version.lib")
  129. #pragma comment (lib, "shlwapi.lib")
  130. #pragma comment (lib, "winmm.lib")
  131. #ifdef _NATIVE_WCHAR_T_DEFINED
  132. #ifdef _DEBUG
  133. #pragma comment (lib, "comsuppwd.lib")
  134. #else
  135. #pragma comment (lib, "comsuppw.lib")
  136. #endif
  137. #else
  138. #ifdef _DEBUG
  139. #pragma comment (lib, "comsuppd.lib")
  140. #else
  141. #pragma comment (lib, "comsupp.lib")
  142. #endif
  143. #endif
  144. #endif
  145. /* Used with DynamicLibrary to simplify importing functions from a win32 DLL.
  146. dll: the DynamicLibrary object
  147. functionName: function to import
  148. localFunctionName: name you want to use to actually call it (must be different)
  149. returnType: the return type
  150. params: list of params (bracketed)
  151. */
  152. #define JUCE_LOAD_WINAPI_FUNCTION(dll, functionName, localFunctionName, returnType, params) \
  153. typedef returnType (WINAPI *type##localFunctionName) params; \
  154. type##localFunctionName localFunctionName = (type##localFunctionName) dll.getFunction (#functionName);
  155. //==============================================================================
  156. #elif JUCE_LINUX
  157. #include <arpa/inet.h>
  158. #include <dlfcn.h>
  159. #include <errno.h>
  160. #include <fcntl.h>
  161. #include <fnmatch.h>
  162. #include <net/if.h>
  163. #include <netdb.h>
  164. #include <netinet/in.h>
  165. #include <pthread.h>
  166. #include <pwd.h>
  167. #include <sched.h>
  168. #include <signal.h>
  169. #include <stddef.h>
  170. #include <sys/dir.h>
  171. #include <sys/file.h>
  172. #include <sys/ioctl.h>
  173. #include <sys/mman.h>
  174. #include <sys/prctl.h>
  175. #include <sys/ptrace.h>
  176. #include <sys/socket.h>
  177. #include <sys/stat.h>
  178. #include <sys/syscall.h>
  179. #include <sys/sysinfo.h>
  180. #include <sys/time.h>
  181. #include <sys/types.h>
  182. #include <sys/vfs.h>
  183. #include <sys/wait.h>
  184. #include <sys/timerfd.h>
  185. #include <sys/eventfd.h>
  186. #include <utime.h>
  187. #include <poll.h>
  188. //==============================================================================
  189. #elif JUCE_BSD
  190. #include <arpa/inet.h>
  191. #include <dirent.h>
  192. #include <dlfcn.h>
  193. #include <errno.h>
  194. #include <fcntl.h>
  195. #include <fnmatch.h>
  196. #include <ifaddrs.h>
  197. #include <langinfo.h>
  198. #include <net/if.h>
  199. #include <net/if_dl.h>
  200. #include <netdb.h>
  201. #include <netinet/in.h>
  202. #include <pthread.h>
  203. #include <pwd.h>
  204. #include <sched.h>
  205. #include <signal.h>
  206. #include <stddef.h>
  207. #include <sys/file.h>
  208. #include <sys/ioctl.h>
  209. #include <sys/mman.h>
  210. #include <sys/mount.h>
  211. #include <sys/ptrace.h>
  212. #include <sys/socket.h>
  213. #include <sys/stat.h>
  214. #include <sys/sysctl.h>
  215. #include <sys/time.h>
  216. #include <sys/types.h>
  217. #include <sys/user.h>
  218. #include <sys/wait.h>
  219. #include <utime.h>
  220. #include <poll.h>
  221. //==============================================================================
  222. #elif JUCE_ANDROID
  223. #include <jni.h>
  224. #include <pthread.h>
  225. #include <sched.h>
  226. #include <sys/time.h>
  227. #include <utime.h>
  228. #include <errno.h>
  229. #include <fcntl.h>
  230. #include <dlfcn.h>
  231. #include <sys/stat.h>
  232. #include <sys/statfs.h>
  233. #include <sys/ptrace.h>
  234. #include <sys/sysinfo.h>
  235. #include <sys/mman.h>
  236. #include <pwd.h>
  237. #include <dirent.h>
  238. #include <fnmatch.h>
  239. #include <sys/wait.h>
  240. #include <sys/timerfd.h>
  241. #include <sys/eventfd.h>
  242. #include <android/api-level.h>
  243. #include <poll.h>
  244. // If you are getting include errors here, then you need to re-build
  245. // the Projucer and re-save your .jucer file.
  246. #include <cpu-features.h>
  247. #endif
  248. // Need to clear various moronic redefinitions made by system headers..
  249. #undef max
  250. #undef min
  251. #undef direct
  252. #undef check