LMMS
Loading...
Searching...
No Matches
juce_BasicNativeHeaders.h
Go to the documentation of this file.
1/*
2 ==============================================================================
3
4 This file is part of the JUCE library.
5 Copyright (c) 2022 - Raw Material Software Limited
6
7 JUCE is an open source library subject to commercial or open-source
8 licensing.
9
10 The code included in this file is provided under the terms of the ISC license
11 http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 To use, copy, modify, and/or distribute this software for any purpose with or
13 without fee is hereby granted provided that the above copyright notice and
14 this permission notice appear in all copies.
15
16 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 DISCLAIMED.
19
20 ==============================================================================
21*/
22
23#pragma once
24
25#undef T
26
27//==============================================================================
28#if JUCE_MAC || JUCE_IOS
29
30 #if JUCE_IOS
31 #if JUCE_MODULE_AVAILABLE_juce_opengl && defined (__IPHONE_12_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_12_0
32 #define GLES_SILENCE_DEPRECATION 1
33 #endif
34
35 #import <Foundation/Foundation.h>
36 #import <UIKit/UIKit.h>
37 #import <CoreData/CoreData.h>
38 #import <MobileCoreServices/MobileCoreServices.h>
39 #include <sys/fcntl.h>
40 #else
41 #if JUCE_MODULE_AVAILABLE_juce_opengl && defined (MAC_OS_X_VERSION_10_14) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_14
42 #define GL_SILENCE_DEPRECATION 1
43 #endif
44
45 #import <Cocoa/Cocoa.h>
46 #if (! defined MAC_OS_X_VERSION_10_12) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12
47 #define NSEventModifierFlagCommand NSCommandKeyMask
48 #define NSEventModifierFlagControl NSControlKeyMask
49 #define NSEventModifierFlagHelp NSHelpKeyMask
50 #define NSEventModifierFlagNumericPad NSNumericPadKeyMask
51 #define NSEventModifierFlagOption NSAlternateKeyMask
52 #define NSEventModifierFlagShift NSShiftKeyMask
53 #define NSCompositingOperationSourceOver NSCompositeSourceOver
54 #define NSEventMaskApplicationDefined NSApplicationDefinedMask
55 #define NSEventTypeApplicationDefined NSApplicationDefined
56 #define NSEventTypeCursorUpdate NSCursorUpdate
57 #define NSEventTypeMouseMoved NSMouseMoved
58 #define NSEventTypeLeftMouseDown NSLeftMouseDown
59 #define NSEventTypeRightMouseDown NSRightMouseDown
60 #define NSEventTypeOtherMouseDown NSOtherMouseDown
61 #define NSEventTypeLeftMouseUp NSLeftMouseUp
62 #define NSEventTypeRightMouseUp NSRightMouseUp
63 #define NSEventTypeOtherMouseUp NSOtherMouseUp
64 #define NSEventTypeLeftMouseDragged NSLeftMouseDragged
65 #define NSEventTypeRightMouseDragged NSRightMouseDragged
66 #define NSEventTypeOtherMouseDragged NSOtherMouseDragged
67 #define NSEventTypeScrollWheel NSScrollWheel
68 #define NSEventTypeKeyDown NSKeyDown
69 #define NSEventTypeKeyUp NSKeyUp
70 #define NSEventTypeFlagsChanged NSFlagsChanged
71 #define NSEventMaskAny NSAnyEventMask
72 #define NSWindowStyleMaskBorderless NSBorderlessWindowMask
73 #define NSWindowStyleMaskClosable NSClosableWindowMask
74 #define NSWindowStyleMaskFullScreen NSFullScreenWindowMask
75 #define NSWindowStyleMaskMiniaturizable NSMiniaturizableWindowMask
76 #define NSWindowStyleMaskResizable NSResizableWindowMask
77 #define NSWindowStyleMaskTitled NSTitledWindowMask
78 #define NSAlertStyleCritical NSCriticalAlertStyle
79 #define NSControlSizeRegular NSRegularControlSize
80 #define NSEventTypeMouseEntered NSMouseEntered
81 #define NSEventTypeMouseExited NSMouseExited
82 #define NSAlertStyleInformational NSInformationalAlertStyle
83 #define NSEventTypeTabletPoint NSTabletPoint
84 #define NSEventTypeTabletProximity NSTabletProximity
85 #define NSEventTypeFlagsChanged NSFlagsChanged
86 #define NSEventTypeAppKitDefined NSAppKitDefined
87 #define NSEventTypeSystemDefined NSSystemDefined
88 #define NSEventTypeApplicationDefined NSApplicationDefined
89 #define NSEventTypePeriodic NSPeriodic
90 #define NSEventTypeSmartMagnify NSEventTypeSmartMagnify
91 #endif
92 #import <CoreAudio/HostTime.h>
93 #include <sys/dir.h>
94 #endif
95
96 #include <sys/socket.h>
97 #include <sys/sysctl.h>
98 #include <sys/stat.h>
99 #include <sys/param.h>
100 #include <sys/mount.h>
101 #include <sys/utsname.h>
102 #include <sys/mman.h>
103 #include <fnmatch.h>
104 #include <utime.h>
105 #include <dlfcn.h>
106 #include <ifaddrs.h>
107 #include <net/if_dl.h>
108 #include <mach/mach_time.h>
109 #include <mach-o/dyld.h>
110 #include <objc/runtime.h>
111 #include <objc/objc.h>
112 #include <objc/message.h>
113 #include <poll.h>
114
115//==============================================================================
116#elif JUCE_WINDOWS
117 #if JUCE_MSVC
118 #ifndef _CPPRTTI
119 #error "You're compiling without RTTI enabled! This is needed for a lot of JUCE classes, please update your compiler settings!"
120 #endif
121
122 #ifndef _CPPUNWIND
123 #error "You're compiling without exceptions enabled! This is needed for a lot of JUCE classes, please update your compiler settings!"
124 #endif
125
126 #pragma warning (push, 0) // disable all warnings whilst including system headers
127 #endif
128
129 #define NOMINMAX
130
131 #define _WINSOCK_DEPRECATED_NO_WARNINGS 1
132 #define STRICT 1
133 #define WIN32_LEAN_AND_MEAN 1
134 #if JUCE_MINGW
135 #if ! defined (_WIN32_WINNT)
136 #define _WIN32_WINNT 0x0600
137 #endif
138 #else
139 #define _WIN32_WINNT 0x0602
140 #endif
141 #define _UNICODE 1
142 #define UNICODE 1
143 #ifndef _WIN32_IE
144 #define _WIN32_IE 0x0501
145 #endif
146
147 #include <windows.h>
148 #include <shellapi.h>
149 #include <tchar.h>
150 #include <stddef.h>
151 #include <ctime>
152 #include <wininet.h>
153 #include <nb30.h>
154 #include <winsock2.h>
155 #include <ws2tcpip.h>
156 #include <iphlpapi.h>
157 #include <accctrl.h>
158 #include <aclapi.h>
159
160 #if ! JUCE_CXX17_IS_AVAILABLE
161 #pragma push_macro ("WIN_NOEXCEPT")
162 #define WIN_NOEXCEPT
163 #endif
164
165 #include <mapi.h>
166
167 #if ! JUCE_CXX17_IS_AVAILABLE
168 #pragma pop_macro ("WIN_NOEXCEPT")
169 #endif
170
171 #include <float.h>
172 #include <process.h>
173 #include <shlobj.h>
174 #include <shlwapi.h>
175 #include <mmsystem.h>
176 #include <winioctl.h>
177
178 #if JUCE_MINGW
179 #include <basetyps.h>
180 #include <sys/time.h>
181 #ifndef alloca
182 #define alloca __builtin_alloca
183 #endif
184 #else
185 #include <crtdbg.h>
186 #include <comutil.h>
187 #endif
188
189 #ifndef S_FALSE
190 #define S_FALSE (1) // (apparently some obscure win32 dev environments don't define this)
191 #endif
192
193 #undef PACKED
194
195 #if JUCE_MSVC
196 #pragma warning (pop)
197 #pragma warning (4: 4511 4512 4100)
198 #endif
199
200 #if ! JUCE_MINGW && ! JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES
201 #pragma comment (lib, "kernel32.lib")
202 #pragma comment (lib, "user32.lib")
203 #pragma comment (lib, "wininet.lib")
204 #pragma comment (lib, "advapi32.lib")
205 #pragma comment (lib, "ws2_32.lib")
206 #pragma comment (lib, "version.lib")
207 #pragma comment (lib, "shlwapi.lib")
208 #pragma comment (lib, "winmm.lib")
209
210 #ifdef _NATIVE_WCHAR_T_DEFINED
211 #ifdef _DEBUG
212 #pragma comment (lib, "comsuppwd.lib")
213 #else
214 #pragma comment (lib, "comsuppw.lib")
215 #endif
216 #else
217 #ifdef _DEBUG
218 #pragma comment (lib, "comsuppd.lib")
219 #else
220 #pragma comment (lib, "comsupp.lib")
221 #endif
222 #endif
223 #endif
224
225 /* Used with DynamicLibrary to simplify importing functions from a win32 DLL.
226
227 dll: the DynamicLibrary object
228 functionName: function to import
229 localFunctionName: name you want to use to actually call it (must be different)
230 returnType: the return type
231 params: list of params (bracketed)
232 */
233 #define JUCE_LOAD_WINAPI_FUNCTION(dll, functionName, localFunctionName, returnType, params) \
234 typedef returnType (WINAPI *type##localFunctionName) params; \
235 type##localFunctionName localFunctionName = (type##localFunctionName) dll.getFunction (#functionName);
236
237//==============================================================================
238#elif JUCE_LINUX
239 #include <arpa/inet.h>
240 #include <dlfcn.h>
241 #include <errno.h>
242 #include <fcntl.h>
243 #include <fnmatch.h>
244 #include <net/if.h>
245 #include <netdb.h>
246 #include <netinet/in.h>
247 #include <pthread.h>
248 #include <pwd.h>
249 #include <sched.h>
250 #include <signal.h>
251 #include <stddef.h>
252 #include <sys/dir.h>
253 #include <sys/file.h>
254 #include <sys/ioctl.h>
255 #include <sys/mman.h>
256 #include <sys/prctl.h>
257 #include <sys/ptrace.h>
258 #include <sys/socket.h>
259 #include <sys/stat.h>
260 #include <sys/sysinfo.h>
261 #include <sys/time.h>
262 #include <sys/types.h>
263 #include <sys/vfs.h>
264 #include <sys/wait.h>
265 #include <utime.h>
266 #include <poll.h>
267
268//==============================================================================
269#elif JUCE_BSD
270 #include <arpa/inet.h>
271 #include <dirent.h>
272 #include <dlfcn.h>
273 #include <errno.h>
274 #include <fcntl.h>
275 #include <fnmatch.h>
276 #include <ifaddrs.h>
277 #include <langinfo.h>
278 #include <net/if.h>
279 #include <net/if_dl.h>
280 #include <netdb.h>
281 #include <netinet/in.h>
282 #include <pthread.h>
283 #include <pwd.h>
284 #include <sched.h>
285 #include <signal.h>
286 #include <stddef.h>
287 #include <sys/file.h>
288 #include <sys/ioctl.h>
289 #include <sys/mman.h>
290 #include <sys/mount.h>
291 #include <sys/ptrace.h>
292 #include <sys/socket.h>
293 #include <sys/stat.h>
294 #include <sys/sysctl.h>
295 #include <sys/time.h>
296 #include <sys/types.h>
297 #include <sys/user.h>
298 #include <sys/wait.h>
299 #include <utime.h>
300 #include <poll.h>
301
302//==============================================================================
303#elif JUCE_ANDROID
304 #include <jni.h>
305 #include <pthread.h>
306 #include <sched.h>
307 #include <sys/time.h>
308 #include <utime.h>
309 #include <errno.h>
310 #include <fcntl.h>
311 #include <dlfcn.h>
312 #include <sys/stat.h>
313 #include <sys/statfs.h>
314 #include <sys/ptrace.h>
315 #include <sys/sysinfo.h>
316 #include <sys/mman.h>
317 #include <pwd.h>
318 #include <dirent.h>
319 #include <fnmatch.h>
320 #include <sys/wait.h>
321 #include <android/api-level.h>
322 #include <poll.h>
323
324 // If you are getting include errors here, then you to re-build the Projucer
325 // and re-save your .jucer file.
326 #include <cpu-features.h>
327#endif
328
329// Need to clear various moronic redefinitions made by system headers..
330#undef max
331#undef min
332#undef direct
333#undef check