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.

268 lines
8.9KB

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