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.

270 lines
8.9KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2016 - ROLI Ltd.
  5. Permission is granted to use this software under the terms of the ISC license
  6. http://www.isc.org/downloads/software-support-policy/isc-license/
  7. Permission to use, copy, modify, and/or distribute this software for any
  8. purpose with or without fee is hereby granted, provided that the above
  9. copyright notice and this permission notice appear in all copies.
  10. THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH REGARD
  11. TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
  12. FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT,
  13. OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
  14. USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  15. TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
  16. OF THIS SOFTWARE.
  17. -----------------------------------------------------------------------------
  18. To release a closed-source product which uses other parts of JUCE not
  19. licensed under the ISC terms, commercial licenses are available: visit
  20. www.juce.com for more information.
  21. ==============================================================================
  22. */
  23. #ifndef JUCE_BASICNATIVEHEADERS_H_INCLUDED
  24. #define JUCE_BASICNATIVEHEADERS_H_INCLUDED
  25. #undef T
  26. //==============================================================================
  27. #if JUCE_MAC || JUCE_IOS
  28. #if JUCE_IOS
  29. #import <Foundation/Foundation.h>
  30. #import <UIKit/UIKit.h>
  31. #import <CoreData/CoreData.h>
  32. #import <MobileCoreServices/MobileCoreServices.h>
  33. #include <sys/fcntl.h>
  34. #else
  35. #import <Cocoa/Cocoa.h>
  36. #if (! defined MAC_OS_X_VERSION_10_12) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12
  37. #define NSEventModifierFlagCommand NSCommandKeyMask
  38. #define NSEventModifierFlagControl NSControlKeyMask
  39. #define NSEventModifierFlagHelp NSHelpKeyMask
  40. #define NSEventModifierFlagNumericPad NSNumericPadKeyMask
  41. #define NSEventModifierFlagOption NSAlternateKeyMask
  42. #define NSEventModifierFlagShift NSShiftKeyMask
  43. #define NSCompositingOperationSourceOver NSCompositeSourceOver
  44. #define NSEventMaskApplicationDefined NSApplicationDefinedMask
  45. #define NSEventTypeApplicationDefined NSApplicationDefined
  46. #define NSEventTypeCursorUpdate NSCursorUpdate
  47. #define NSEventTypeMouseMoved NSMouseMoved
  48. #define NSEventTypeLeftMouseDown NSLeftMouseDown
  49. #define NSEventTypeRightMouseDown NSRightMouseDown
  50. #define NSEventTypeOtherMouseDown NSOtherMouseDown
  51. #define NSEventTypeLeftMouseUp NSLeftMouseUp
  52. #define NSEventTypeRightMouseUp NSRightMouseUp
  53. #define NSEventTypeOtherMouseUp NSOtherMouseUp
  54. #define NSEventTypeLeftMouseDragged NSLeftMouseDragged
  55. #define NSEventTypeRightMouseDragged NSRightMouseDragged
  56. #define NSEventTypeOtherMouseDragged NSOtherMouseDragged
  57. #define NSEventTypeScrollWheel NSScrollWheel
  58. #define NSEventTypeKeyDown NSKeyDown
  59. #define NSEventTypeKeyUp NSKeyUp
  60. #define NSEventTypeFlagsChanged NSFlagsChanged
  61. #define NSEventMaskAny NSAnyEventMask
  62. #define NSWindowStyleMaskBorderless NSBorderlessWindowMask
  63. #define NSWindowStyleMaskClosable NSClosableWindowMask
  64. #define NSWindowStyleMaskFullScreen NSFullScreenWindowMask
  65. #define NSWindowStyleMaskMiniaturizable NSMiniaturizableWindowMask
  66. #define NSWindowStyleMaskResizable NSResizableWindowMask
  67. #define NSWindowStyleMaskTitled NSTitledWindowMask
  68. #define NSAlertStyleCritical NSCriticalAlertStyle
  69. #define NSControlSizeRegular NSRegularControlSize
  70. #define NSEventTypeMouseEntered NSMouseEntered
  71. #define NSEventTypeMouseExited NSMouseExited
  72. #define NSAlertStyleInformational NSInformationalAlertStyle
  73. #define NSEventTypeTabletPoint NSTabletPoint
  74. #define NSEventTypeTabletProximity NSTabletProximity
  75. #endif
  76. #import <CoreAudio/HostTime.h>
  77. #include <sys/dir.h>
  78. #endif
  79. #include <sys/socket.h>
  80. #include <sys/sysctl.h>
  81. #include <sys/stat.h>
  82. #include <sys/param.h>
  83. #include <sys/mount.h>
  84. #include <sys/utsname.h>
  85. #include <sys/mman.h>
  86. #include <fnmatch.h>
  87. #include <utime.h>
  88. #include <dlfcn.h>
  89. #include <ifaddrs.h>
  90. #include <net/if_dl.h>
  91. #include <mach/mach_time.h>
  92. #include <mach-o/dyld.h>
  93. #include <objc/runtime.h>
  94. #include <objc/objc.h>
  95. #include <objc/message.h>
  96. //==============================================================================
  97. #elif JUCE_WINDOWS
  98. #if JUCE_MSVC
  99. #ifndef _CPPRTTI
  100. #error "You're compiling without RTTI enabled! This is needed for a lot of JUCE classes, please update your compiler settings!"
  101. #endif
  102. #ifndef _CPPUNWIND
  103. #error "You're compiling without exceptions enabled! This is needed for a lot of JUCE classes, please update your compiler settings!"
  104. #endif
  105. #pragma warning (push, 0) // disable all warnings whilst including system headers
  106. #endif
  107. #define NOMINMAX
  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 <iphlpapi.h>
  128. #include <mapi.h>
  129. #include <float.h>
  130. #include <process.h>
  131. #include <shlobj.h>
  132. #include <shlwapi.h>
  133. #include <mmsystem.h>
  134. #if JUCE_MINGW
  135. #include <basetyps.h>
  136. #include <sys/time.h>
  137. #ifndef alloca
  138. #define alloca __builtin_alloca
  139. #endif
  140. #else
  141. #include <crtdbg.h>
  142. #include <comutil.h>
  143. #endif
  144. #ifndef S_FALSE
  145. #define S_FALSE (1) // (apparently some obscure win32 dev environments don't define this)
  146. #endif
  147. #undef PACKED
  148. #if JUCE_MSVC
  149. #pragma warning (pop)
  150. #pragma warning (4: 4511 4512 4100 /*4365*/) // (enable some warnings that are turned off in VC8)
  151. #endif
  152. #if JUCE_MSVC && ! JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES
  153. #pragma comment (lib, "kernel32.lib")
  154. #pragma comment (lib, "user32.lib")
  155. #pragma comment (lib, "wininet.lib")
  156. #pragma comment (lib, "advapi32.lib")
  157. #pragma comment (lib, "ws2_32.lib")
  158. #pragma comment (lib, "version.lib")
  159. #pragma comment (lib, "shlwapi.lib")
  160. #pragma comment (lib, "winmm.lib")
  161. #ifdef _NATIVE_WCHAR_T_DEFINED
  162. #ifdef _DEBUG
  163. #pragma comment (lib, "comsuppwd.lib")
  164. #else
  165. #pragma comment (lib, "comsuppw.lib")
  166. #endif
  167. #else
  168. #ifdef _DEBUG
  169. #pragma comment (lib, "comsuppd.lib")
  170. #else
  171. #pragma comment (lib, "comsupp.lib")
  172. #endif
  173. #endif
  174. #endif
  175. /* Used with DynamicLibrary to simplify importing functions from a win32 DLL.
  176. dll: the DynamicLibrary object
  177. functionName: function to import
  178. localFunctionName: name you want to use to actually call it (must be different)
  179. returnType: the return type
  180. params: list of params (bracketed)
  181. */
  182. #define JUCE_LOAD_WINAPI_FUNCTION(dll, functionName, localFunctionName, returnType, params) \
  183. typedef returnType (WINAPI *type##localFunctionName) params; \
  184. type##localFunctionName localFunctionName = (type##localFunctionName) dll.getFunction (#functionName);
  185. //==============================================================================
  186. #elif JUCE_LINUX
  187. #include <sched.h>
  188. #include <pthread.h>
  189. #include <sys/time.h>
  190. #include <errno.h>
  191. #include <sys/stat.h>
  192. #include <sys/dir.h>
  193. #include <sys/ptrace.h>
  194. #include <sys/vfs.h>
  195. #include <sys/wait.h>
  196. #include <sys/mman.h>
  197. #include <fnmatch.h>
  198. #include <utime.h>
  199. #include <pwd.h>
  200. #include <fcntl.h>
  201. #include <dlfcn.h>
  202. #include <netdb.h>
  203. #include <arpa/inet.h>
  204. #include <netinet/in.h>
  205. #include <sys/types.h>
  206. #include <sys/ioctl.h>
  207. #include <sys/socket.h>
  208. #include <net/if.h>
  209. #include <sys/sysinfo.h>
  210. #include <sys/file.h>
  211. #include <sys/prctl.h>
  212. #include <signal.h>
  213. #include <stddef.h>
  214. //==============================================================================
  215. #elif JUCE_ANDROID
  216. #include <jni.h>
  217. #include <pthread.h>
  218. #include <sched.h>
  219. #include <sys/time.h>
  220. #include <utime.h>
  221. #include <errno.h>
  222. #include <fcntl.h>
  223. #include <dlfcn.h>
  224. #include <sys/stat.h>
  225. #include <sys/statfs.h>
  226. #include <sys/ptrace.h>
  227. #include <sys/sysinfo.h>
  228. #include <sys/mman.h>
  229. #include <pwd.h>
  230. #include <dirent.h>
  231. #include <fnmatch.h>
  232. #include <sys/wait.h>
  233. #endif
  234. // Need to clear various moronic redefinitions made by system headers..
  235. #undef max
  236. #undef min
  237. #undef direct
  238. #undef check
  239. #endif // JUCE_BASICNATIVEHEADERS_H_INCLUDED