juce_BasicNativeHeaders.h 6.4 KB

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