OpenShot Audio Library | OpenShotAudio: juce_CompilerWarnings.h Source File

OpenShot Audio Library | OpenShotAudio 0.4.0

Loading...
Searching...
No Matches
juce_CompilerWarnings.h
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#include "juce_TargetPlatform.h"
26
31#define JUCE_NTH_ARG_(_00, _01, _02, _03, _04, _05, _06, _07, _08, _09, \
32 _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, \
33 _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, \
34 _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, \
35 _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, N, ...)\
36 N
37
38#define JUCE_EACH_00_(FN)
39#define JUCE_EACH_01_(FN, X) FN(X)
40#define JUCE_EACH_02_(FN, X, ...) FN(X) JUCE_EACH_01_(FN, __VA_ARGS__)
41#define JUCE_EACH_03_(FN, X, ...) FN(X) JUCE_EACH_02_(FN, __VA_ARGS__)
42#define JUCE_EACH_04_(FN, X, ...) FN(X) JUCE_EACH_03_(FN, __VA_ARGS__)
43#define JUCE_EACH_05_(FN, X, ...) FN(X) JUCE_EACH_04_(FN, __VA_ARGS__)
44#define JUCE_EACH_06_(FN, X, ...) FN(X) JUCE_EACH_05_(FN, __VA_ARGS__)
45#define JUCE_EACH_07_(FN, X, ...) FN(X) JUCE_EACH_06_(FN, __VA_ARGS__)
46#define JUCE_EACH_08_(FN, X, ...) FN(X) JUCE_EACH_07_(FN, __VA_ARGS__)
47#define JUCE_EACH_09_(FN, X, ...) FN(X) JUCE_EACH_08_(FN, __VA_ARGS__)
48#define JUCE_EACH_10_(FN, X, ...) FN(X) JUCE_EACH_09_(FN, __VA_ARGS__)
49#define JUCE_EACH_11_(FN, X, ...) FN(X) JUCE_EACH_10_(FN, __VA_ARGS__)
50#define JUCE_EACH_12_(FN, X, ...) FN(X) JUCE_EACH_11_(FN, __VA_ARGS__)
51#define JUCE_EACH_13_(FN, X, ...) FN(X) JUCE_EACH_12_(FN, __VA_ARGS__)
52#define JUCE_EACH_14_(FN, X, ...) FN(X) JUCE_EACH_13_(FN, __VA_ARGS__)
53#define JUCE_EACH_15_(FN, X, ...) FN(X) JUCE_EACH_14_(FN, __VA_ARGS__)
54#define JUCE_EACH_16_(FN, X, ...) FN(X) JUCE_EACH_15_(FN, __VA_ARGS__)
55#define JUCE_EACH_17_(FN, X, ...) FN(X) JUCE_EACH_16_(FN, __VA_ARGS__)
56#define JUCE_EACH_18_(FN, X, ...) FN(X) JUCE_EACH_17_(FN, __VA_ARGS__)
57#define JUCE_EACH_19_(FN, X, ...) FN(X) JUCE_EACH_18_(FN, __VA_ARGS__)
58#define JUCE_EACH_20_(FN, X, ...) FN(X) JUCE_EACH_19_(FN, __VA_ARGS__)
59#define JUCE_EACH_21_(FN, X, ...) FN(X) JUCE_EACH_20_(FN, __VA_ARGS__)
60#define JUCE_EACH_22_(FN, X, ...) FN(X) JUCE_EACH_21_(FN, __VA_ARGS__)
61#define JUCE_EACH_23_(FN, X, ...) FN(X) JUCE_EACH_22_(FN, __VA_ARGS__)
62#define JUCE_EACH_24_(FN, X, ...) FN(X) JUCE_EACH_23_(FN, __VA_ARGS__)
63#define JUCE_EACH_25_(FN, X, ...) FN(X) JUCE_EACH_24_(FN, __VA_ARGS__)
64#define JUCE_EACH_26_(FN, X, ...) FN(X) JUCE_EACH_25_(FN, __VA_ARGS__)
65#define JUCE_EACH_27_(FN, X, ...) FN(X) JUCE_EACH_26_(FN, __VA_ARGS__)
66#define JUCE_EACH_28_(FN, X, ...) FN(X) JUCE_EACH_27_(FN, __VA_ARGS__)
67#define JUCE_EACH_29_(FN, X, ...) FN(X) JUCE_EACH_28_(FN, __VA_ARGS__)
68#define JUCE_EACH_30_(FN, X, ...) FN(X) JUCE_EACH_29_(FN, __VA_ARGS__)
69#define JUCE_EACH_31_(FN, X, ...) FN(X) JUCE_EACH_30_(FN, __VA_ARGS__)
70#define JUCE_EACH_32_(FN, X, ...) FN(X) JUCE_EACH_31_(FN, __VA_ARGS__)
71#define JUCE_EACH_33_(FN, X, ...) FN(X) JUCE_EACH_32_(FN, __VA_ARGS__)
72#define JUCE_EACH_34_(FN, X, ...) FN(X) JUCE_EACH_33_(FN, __VA_ARGS__)
73#define JUCE_EACH_35_(FN, X, ...) FN(X) JUCE_EACH_34_(FN, __VA_ARGS__)
74#define JUCE_EACH_36_(FN, X, ...) FN(X) JUCE_EACH_35_(FN, __VA_ARGS__)
75#define JUCE_EACH_37_(FN, X, ...) FN(X) JUCE_EACH_36_(FN, __VA_ARGS__)
76#define JUCE_EACH_38_(FN, X, ...) FN(X) JUCE_EACH_37_(FN, __VA_ARGS__)
77#define JUCE_EACH_39_(FN, X, ...) FN(X) JUCE_EACH_38_(FN, __VA_ARGS__)
78#define JUCE_EACH_40_(FN, X, ...) FN(X) JUCE_EACH_39_(FN, __VA_ARGS__)
79#define JUCE_EACH_41_(FN, X, ...) FN(X) JUCE_EACH_40_(FN, __VA_ARGS__)
80#define JUCE_EACH_42_(FN, X, ...) FN(X) JUCE_EACH_41_(FN, __VA_ARGS__)
81#define JUCE_EACH_43_(FN, X, ...) FN(X) JUCE_EACH_42_(FN, __VA_ARGS__)
82#define JUCE_EACH_44_(FN, X, ...) FN(X) JUCE_EACH_43_(FN, __VA_ARGS__)
83#define JUCE_EACH_45_(FN, X, ...) FN(X) JUCE_EACH_44_(FN, __VA_ARGS__)
84#define JUCE_EACH_46_(FN, X, ...) FN(X) JUCE_EACH_45_(FN, __VA_ARGS__)
85#define JUCE_EACH_47_(FN, X, ...) FN(X) JUCE_EACH_46_(FN, __VA_ARGS__)
86#define JUCE_EACH_48_(FN, X, ...) FN(X) JUCE_EACH_47_(FN, __VA_ARGS__)
87#define JUCE_EACH_49_(FN, X, ...) FN(X) JUCE_EACH_48_(FN, __VA_ARGS__)
88
90#define JUCE_EACH(FN, ...) \
91 JUCE_NTH_ARG_(, __VA_ARGS__, \
92 JUCE_EACH_49_, \
93 JUCE_EACH_48_, \
94 JUCE_EACH_47_, \
95 JUCE_EACH_46_, \
96 JUCE_EACH_45_, \
97 JUCE_EACH_44_, \
98 JUCE_EACH_43_, \
99 JUCE_EACH_42_, \
100 JUCE_EACH_41_, \
101 JUCE_EACH_40_, \
102 JUCE_EACH_39_, \
103 JUCE_EACH_38_, \
104 JUCE_EACH_37_, \
105 JUCE_EACH_36_, \
106 JUCE_EACH_35_, \
107 JUCE_EACH_34_, \
108 JUCE_EACH_33_, \
109 JUCE_EACH_32_, \
110 JUCE_EACH_31_, \
111 JUCE_EACH_30_, \
112 JUCE_EACH_29_, \
113 JUCE_EACH_28_, \
114 JUCE_EACH_27_, \
115 JUCE_EACH_26_, \
116 JUCE_EACH_25_, \
117 JUCE_EACH_24_, \
118 JUCE_EACH_23_, \
119 JUCE_EACH_22_, \
120 JUCE_EACH_21_, \
121 JUCE_EACH_20_, \
122 JUCE_EACH_19_, \
123 JUCE_EACH_18_, \
124 JUCE_EACH_17_, \
125 JUCE_EACH_16_, \
126 JUCE_EACH_15_, \
127 JUCE_EACH_14_, \
128 JUCE_EACH_13_, \
129 JUCE_EACH_12_, \
130 JUCE_EACH_11_, \
131 JUCE_EACH_10_, \
132 JUCE_EACH_09_, \
133 JUCE_EACH_08_, \
134 JUCE_EACH_07_, \
135 JUCE_EACH_06_, \
136 JUCE_EACH_05_, \
137 JUCE_EACH_04_, \
138 JUCE_EACH_03_, \
139 JUCE_EACH_02_, \
140 JUCE_EACH_01_, \
141 JUCE_EACH_00_) \
142 (FN, __VA_ARGS__)
143
145#define JUCE_CONCAT_(a, b) a##b
146#define JUCE_CONCAT(a, b) JUCE_CONCAT_(a, b)
147
149#define JUCE_TO_STRING(x) #x
150
151#if JUCE_CLANG || JUCE_GCC || JUCE_MINGW
152 #define JUCE_IGNORE_GCC_IMPL_(compiler, warning)
153 #define JUCE_IGNORE_GCC_IMPL_0(compiler, warning)
154 #define JUCE_IGNORE_GCC_IMPL_1(compiler, warning) \
155 _Pragma(JUCE_TO_STRING(compiler diagnostic ignored warning))
156
158 #if defined (__has_warning)
159 #define JUCE_IGNORE_GCC_LIKE(compiler, warning) \
160 JUCE_CONCAT(JUCE_IGNORE_GCC_IMPL_, __has_warning(warning))(compiler, warning)
161 #else
162 #define JUCE_IGNORE_GCC_LIKE(compiler, warning) \
163 JUCE_IGNORE_GCC_IMPL_1(compiler, warning)
164 #endif
165
167 #define JUCE_IGNORE_GCC(warning) JUCE_IGNORE_GCC_LIKE(GCC, warning)
168 #define JUCE_IGNORE_clang(warning) JUCE_IGNORE_GCC_LIKE(clang, warning)
169
170 #define JUCE_IGNORE_WARNINGS_GCC_LIKE(compiler, ...) \
171 _Pragma(JUCE_TO_STRING(compiler diagnostic push)) \
172 JUCE_EACH(JUCE_CONCAT(JUCE_IGNORE_, compiler), __VA_ARGS__)
173
179 #if defined (__has_warning)
180 #define JUCE_PUSH_WARNINGS_GCC_LIKE(compiler, ...) \
181 JUCE_IGNORE_WARNINGS_GCC_LIKE(compiler, __VA_ARGS__)
182 #else
183 #define JUCE_PUSH_WARNINGS_GCC_LIKE(compiler, ...) \
184 JUCE_IGNORE_WARNINGS_GCC_LIKE(compiler, "-Wpragmas", __VA_ARGS__)
185 #endif
186
188 #define JUCE_POP_WARNINGS_GCC_LIKE(compiler) \
189 _Pragma(JUCE_TO_STRING(compiler diagnostic pop))
190
194 #if JUCE_CLANG
195 #define JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE(...) JUCE_PUSH_WARNINGS_GCC_LIKE(clang, __VA_ARGS__)
196 #define JUCE_END_IGNORE_WARNINGS_GCC_LIKE JUCE_POP_WARNINGS_GCC_LIKE(clang)
197 #else
198 #define JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE(...) JUCE_PUSH_WARNINGS_GCC_LIKE(GCC, __VA_ARGS__)
199 #define JUCE_END_IGNORE_WARNINGS_GCC_LIKE JUCE_POP_WARNINGS_GCC_LIKE(GCC)
200 #endif
201#else
202 #define JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE(...)
203 #define JUCE_END_IGNORE_WARNINGS_GCC_LIKE
204#endif
205
209#if JUCE_MSVC
210 #define JUCE_IGNORE_MSVC(warnings) __pragma(warning(disable:warnings))
211 #define JUCE_BEGIN_IGNORE_WARNINGS_LEVEL_MSVC(level, warnings) \
212 __pragma(warning(push, level)) JUCE_IGNORE_MSVC(warnings)
213 #define JUCE_BEGIN_IGNORE_WARNINGS_MSVC(warnings) \
214 __pragma(warning(push)) JUCE_IGNORE_MSVC(warnings)
215 #define JUCE_END_IGNORE_WARNINGS_MSVC __pragma(warning(pop))
216#else
217 #define JUCE_IGNORE_MSVC(warnings)
218 #define JUCE_BEGIN_IGNORE_WARNINGS_LEVEL_MSVC(level, warnings)
219 #define JUCE_BEGIN_IGNORE_WARNINGS_MSVC(warnings)
220 #define JUCE_END_IGNORE_WARNINGS_MSVC
221#endif
222
223#if JUCE_MAC || JUCE_IOS
224 #define JUCE_SANITIZER_ATTRIBUTE_MINIMUM_CLANG_VERSION 11
225#else
226 #define JUCE_SANITIZER_ATTRIBUTE_MINIMUM_CLANG_VERSION 9
227#endif
228
233#if JUCE_CLANG && __clang_major__ >= JUCE_SANITIZER_ATTRIBUTE_MINIMUM_CLANG_VERSION
234 #define JUCE_BEGIN_NO_SANITIZE(warnings) \
235 _Pragma (JUCE_TO_STRING (clang attribute push (__attribute__ ((no_sanitize (warnings))), apply_to=function)))
236 #define JUCE_END_NO_SANITIZE _Pragma (JUCE_TO_STRING (clang attribute pop))
237#else
238 #define JUCE_BEGIN_NO_SANITIZE(warnings)
239 #define JUCE_END_NO_SANITIZE
240#endif
241
242#undef JUCE_SANITIZER_ATTRIBUTE_MINIMUM_CLANG_VERSION