JUCE-7.0.12-0-g4f43011b96 JUCE-7.0.12-0-g4f43011b96
JUCE — C++ application framework with suport for VST, VST3, LV2 audio plug-ins

« « « Anklang Documentation
Loading...
Searching...
No Matches
juce_core.cpp
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#ifdef JUCE_CORE_H_INCLUDED
24 /* When you add this cpp file to your project, you mustn't include it in a file where you've
25 already included any other headers - just put it inside a file on its own, possibly with your config
26 flags preceding it, but don't include anything else. That also includes avoiding any automatic prefix
27 header files that the compiler may be using.
28 */
29 #error "Incorrect use of JUCE cpp file"
30#endif
31
32#define JUCE_CORE_INCLUDE_OBJC_HELPERS 1
33#define JUCE_CORE_INCLUDE_COM_SMART_PTR 1
34#define JUCE_CORE_INCLUDE_NATIVE_HEADERS 1
35#define JUCE_CORE_INCLUDE_JNI_HELPERS 1
36
37#include "juce_core.h"
38
39#include <cctype>
40#include <cstdarg>
41#include <locale>
42#include <thread>
43
44#if ! (JUCE_ANDROID || JUCE_BSD)
45 #include <sys/timeb.h>
46 #include <cwctype>
47#endif
48
49#if JUCE_WINDOWS
50 #include <ctime>
51
52 #if JUCE_MINGW
53 #include <ws2spi.h>
54 #include <cstdio>
55 #include <locale.h>
56 #else
57 JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4091)
58 #include <Dbghelp.h>
59 JUCE_END_IGNORE_WARNINGS_MSVC
60
61 #if ! JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES
62 #pragma comment (lib, "DbgHelp.lib")
63 #endif
64 #endif
65
66#else
67 #if JUCE_LINUX || JUCE_BSD || JUCE_ANDROID
68 #include <sys/types.h>
69 #include <sys/socket.h>
70 #include <sys/errno.h>
71 #include <unistd.h>
72 #include <netinet/in.h>
73 #endif
74
75 #if JUCE_WASM
76 #include <stdio.h>
77 #include <sys/types.h>
78 #include <sys/socket.h>
79 #include <errno.h>
80 #include <unistd.h>
81 #include <netinet/in.h>
82 #include <sys/stat.h>
83 #endif
84
85 #if JUCE_LINUX || JUCE_BSD
86 #include <stdio.h>
87 #include <langinfo.h>
88 #include <ifaddrs.h>
89 #include <sys/resource.h>
90
91 #if JUCE_USE_CURL
92 #include <curl/curl.h>
93 #endif
94 #endif
95
96 #include <pwd.h>
97 #include <fcntl.h>
98 #include <netdb.h>
99 #include <arpa/inet.h>
100 #include <netinet/tcp.h>
101 #include <sys/time.h>
102 #include <net/if.h>
103 #include <sys/ioctl.h>
104
105 #if ! (JUCE_ANDROID || JUCE_WASM)
106 #include <execinfo.h>
107 #endif
108#endif
109
110#if JUCE_MAC || JUCE_IOS
111 #include <xlocale.h>
112 #include <mach/mach.h>
113#endif
114
115#if JUCE_ANDROID
116 #include <ifaddrs.h>
117 #include <android/log.h>
118#endif
119
120#undef check
121
122//==============================================================================
133#include "files/juce_File.cpp"
142#include "maths/juce_Random.cpp"
146#include "misc/juce_Result.cpp"
147#include "misc/juce_Uuid.cpp"
163#include "text/juce_String.cpp"
168#include "text/juce_TextDiff.cpp"
169#include "text/juce_Base64.cpp"
176#include "time/juce_Time.cpp"
187#include "zip/juce_ZipFile.cpp"
192
193//==============================================================================
194#if ! JUCE_WINDOWS
197 #if ! JUCE_ANDROID || __ANDROID_API__ >= 24
199 #endif
200#endif
201
202//==============================================================================
203#if JUCE_MAC || JUCE_IOS
204 #include "native/juce_Files_mac.mm"
205 #include "native/juce_Network_mac.mm"
206 #include "native/juce_Strings_mac.mm"
207 #include "native/juce_SharedCode_intel.h"
208 #include "native/juce_SystemStats_mac.mm"
209 #include "native/juce_Threads_mac.mm"
211 #include "native/juce_Process_mac.mm"
212
213//==============================================================================
214#elif JUCE_WINDOWS
215 #include "native/juce_Files_windows.cpp"
216 #include "native/juce_Network_windows.cpp"
217 #include "native/juce_Registry_windows.cpp"
218 #include "native/juce_SystemStats_windows.cpp"
219 #include "native/juce_Threads_windows.cpp"
220 #include "native/juce_PlatformTimer_windows.cpp"
221
222//==============================================================================
223#elif JUCE_LINUX
227 #if JUCE_USE_CURL
228 #include "native/juce_Network_curl.cpp"
229 #endif
233
234//==============================================================================
235#elif JUCE_BSD
239 #if JUCE_USE_CURL
240 #include "native/juce_Network_curl.cpp"
241 #endif
242 #include "native/juce_SharedCode_intel.h"
246
247//==============================================================================
248#elif JUCE_ANDROID
250 #include "native/juce_JNIHelpers_android.cpp"
251 #include "native/juce_Files_android.cpp"
252 #include "native/juce_Misc_android.cpp"
253 #include "native/juce_Network_android.cpp"
254 #include "native/juce_SystemStats_android.cpp"
255 #include "native/juce_Threads_android.cpp"
256 #include "native/juce_RuntimePermissions_android.cpp"
258
259//==============================================================================
260#elif JUCE_WASM
261 #include "native/juce_SystemStats_wasm.cpp"
263#endif
264
266
272#include "network/juce_URL.cpp"
273
274#if ! JUCE_WASM
278#endif
279
280//==============================================================================
281#if JUCE_UNIT_TESTS
282 #include "containers/juce_HashMap_test.cpp"
283 #include "containers/juce_Optional_test.cpp"
284 #include "containers/juce_Enumerate_test.cpp"
285 #include "maths/juce_MathsFunctions_test.cpp"
286 #include "misc/juce_EnumHelpers_test.cpp"
287 #include "containers/juce_FixedSizeFunction_test.cpp"
288 #include "javascript/juce_JSONSerialisation_test.cpp"
289 #include "memory/juce_SharedResourcePointer_test.cpp"
290 #if JUCE_MAC || JUCE_IOS
291 #include "native/juce_ObjCHelpers_mac_test.mm"
292 #endif
293#endif
294
295//==============================================================================
296namespace juce
297{
298/*
299 As the very long class names here try to explain, the purpose of this code is to cause
300 a linker error if not all of your compile units are consistent in the options that they
301 enable before including JUCE headers. The reason this is important is that if you have
302 two cpp files, and one includes the juce headers with debug enabled, and the other doesn't,
303 then each will be generating code with different memory layouts for the classes, and
304 you'll get subtle and hard-to-track-down memory corruption bugs!
305*/
306#if JUCE_DEBUG
307 this_will_fail_to_link_if_some_of_your_compile_units_are_built_in_debug_mode
308 ::this_will_fail_to_link_if_some_of_your_compile_units_are_built_in_debug_mode() noexcept {}
309#else
310 this_will_fail_to_link_if_some_of_your_compile_units_are_built_in_release_mode
311 ::this_will_fail_to_link_if_some_of_your_compile_units_are_built_in_release_mode() noexcept {}
312#endif
313}
JUCE Namespace.