juce_BasicNativeHeaders.h 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  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. #import <CoreAudio/HostTime.h>
  35. #include <sys/dir.h>
  36. #endif
  37. #include <sys/socket.h>
  38. #include <sys/sysctl.h>
  39. #include <sys/stat.h>
  40. #include <sys/param.h>
  41. #include <sys/mount.h>
  42. #include <sys/utsname.h>
  43. #include <sys/mman.h>
  44. #include <fnmatch.h>
  45. #include <utime.h>
  46. #include <dlfcn.h>
  47. #include <ifaddrs.h>
  48. #include <net/if_dl.h>
  49. #include <mach/mach_time.h>
  50. #include <mach-o/dyld.h>
  51. #include <objc/runtime.h>
  52. #include <objc/objc.h>
  53. #include <objc/message.h>
  54. //==============================================================================
  55. #elif JUCE_WINDOWS
  56. #if JUCE_MSVC
  57. #ifndef _CPPRTTI
  58. #error "You're compiling without RTTI enabled! This is needed for a lot of JUCE classes, please update your compiler settings!"
  59. #endif
  60. #ifndef _CPPUNWIND
  61. #error "You're compiling without exceptions enabled! This is needed for a lot of JUCE classes, please update your compiler settings!"
  62. #endif
  63. #pragma warning (push, 0) // disable all warnings whilst including system headers
  64. #endif
  65. #define STRICT 1
  66. #define WIN32_LEAN_AND_MEAN 1
  67. #if JUCE_MINGW
  68. #define _WIN32_WINNT 0x0501
  69. #else
  70. #define _WIN32_WINNT 0x0600
  71. #endif
  72. #define _UNICODE 1
  73. #define UNICODE 1
  74. #ifndef _WIN32_IE
  75. #define _WIN32_IE 0x0500
  76. #endif
  77. #include <windows.h>
  78. #include <shellapi.h>
  79. #include <tchar.h>
  80. #include <stddef.h>
  81. #include <ctime>
  82. #include <wininet.h>
  83. #include <nb30.h>
  84. #include <iphlpapi.h>
  85. #include <mapi.h>
  86. #include <float.h>
  87. #include <process.h>
  88. #include <shlobj.h>
  89. #include <shlwapi.h>
  90. #include <mmsystem.h>
  91. #if JUCE_MINGW
  92. #include <basetyps.h>
  93. #include <sys/time.h>
  94. #ifndef alloca
  95. #define alloca __builtin_alloca
  96. #endif
  97. #else
  98. #include <crtdbg.h>
  99. #include <comutil.h>
  100. #endif
  101. #undef PACKED
  102. #if JUCE_MSVC
  103. #pragma warning (pop)
  104. #pragma warning (4: 4511 4512 4100 /*4365*/) // (enable some warnings that are turned off in VC8)
  105. #endif
  106. #if JUCE_MSVC && ! JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES
  107. #pragma comment (lib, "kernel32.lib")
  108. #pragma comment (lib, "user32.lib")
  109. #pragma comment (lib, "wininet.lib")
  110. #pragma comment (lib, "advapi32.lib")
  111. #pragma comment (lib, "ws2_32.lib")
  112. #pragma comment (lib, "version.lib")
  113. #pragma comment (lib, "shlwapi.lib")
  114. #pragma comment (lib, "winmm.lib")
  115. #ifdef _NATIVE_WCHAR_T_DEFINED
  116. #ifdef _DEBUG
  117. #pragma comment (lib, "comsuppwd.lib")
  118. #else
  119. #pragma comment (lib, "comsuppw.lib")
  120. #endif
  121. #else
  122. #ifdef _DEBUG
  123. #pragma comment (lib, "comsuppd.lib")
  124. #else
  125. #pragma comment (lib, "comsupp.lib")
  126. #endif
  127. #endif
  128. #endif
  129. /* Used with DynamicLibrary to simplify importing functions from a win32 DLL.
  130. dll: the DynamicLibrary object
  131. functionName: function to import
  132. localFunctionName: name you want to use to actually call it (must be different)
  133. returnType: the return type
  134. params: list of params (bracketed)
  135. */
  136. #define JUCE_LOAD_WINAPI_FUNCTION(dll, functionName, localFunctionName, returnType, params) \
  137. typedef returnType (WINAPI *type##localFunctionName) params; \
  138. type##localFunctionName localFunctionName = (type##localFunctionName) dll.getFunction (#functionName);
  139. //==============================================================================
  140. #elif JUCE_LINUX
  141. #include <sched.h>
  142. #include <pthread.h>
  143. #include <sys/time.h>
  144. #include <errno.h>
  145. #include <sys/stat.h>
  146. #include <sys/dir.h>
  147. #include <sys/ptrace.h>
  148. #include <sys/vfs.h>
  149. #include <sys/wait.h>
  150. #include <sys/mman.h>
  151. #include <fnmatch.h>
  152. #include <utime.h>
  153. #include <pwd.h>
  154. #include <fcntl.h>
  155. #include <dlfcn.h>
  156. #include <netdb.h>
  157. #include <arpa/inet.h>
  158. #include <netinet/in.h>
  159. #include <sys/types.h>
  160. #include <sys/ioctl.h>
  161. #include <sys/socket.h>
  162. #include <net/if.h>
  163. #include <sys/sysinfo.h>
  164. #include <sys/file.h>
  165. #include <sys/prctl.h>
  166. #include <signal.h>
  167. #include <stddef.h>
  168. //==============================================================================
  169. #elif JUCE_ANDROID
  170. #include <jni.h>
  171. #include <pthread.h>
  172. #include <sched.h>
  173. #include <sys/time.h>
  174. #include <utime.h>
  175. #include <errno.h>
  176. #include <fcntl.h>
  177. #include <dlfcn.h>
  178. #include <sys/stat.h>
  179. #include <sys/statfs.h>
  180. #include <sys/ptrace.h>
  181. #include <sys/sysinfo.h>
  182. #include <sys/mman.h>
  183. #include <pwd.h>
  184. #include <dirent.h>
  185. #include <fnmatch.h>
  186. #include <sys/wait.h>
  187. #endif
  188. // Need to clear various moronic redefinitions made by system headers..
  189. #undef max
  190. #undef min
  191. #undef direct
  192. #undef check
  193. #endif // JUCE_BASICNATIVEHEADERS_H_INCLUDED