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.

291 lines
7.5KB

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