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_CompilerSupport.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/*
26 This file provides flags for compiler features that aren't supported on all platforms.
27*/
28
29//==============================================================================
30// GCC
31#if JUCE_GCC
32
33 #if (__GNUC__ * 100 + __GNUC_MINOR__) < 700
34 #error "JUCE requires GCC 7.0 or later"
35 #endif
36
37 #ifndef JUCE_EXCEPTIONS_DISABLED
38 #if ! __EXCEPTIONS
39 #define JUCE_EXCEPTIONS_DISABLED 1
40 #endif
41 #endif
42
43 #define JUCE_CXX14_IS_AVAILABLE (__cplusplus >= 201402L)
44 #define JUCE_CXX17_IS_AVAILABLE (__cplusplus >= 201703L)
45
46#endif
47
48//==============================================================================
49// Clang
50#if JUCE_CLANG
51
52 #if (__clang_major__ < 6)
53 #error "JUCE requires Clang 6 or later"
54 #endif
55
56 #ifndef JUCE_COMPILER_SUPPORTS_ARC
57 #define JUCE_COMPILER_SUPPORTS_ARC 1
58 #endif
59
60 #ifndef JUCE_EXCEPTIONS_DISABLED
61 #if ! __has_feature (cxx_exceptions)
62 #define JUCE_EXCEPTIONS_DISABLED 1
63 #endif
64 #endif
65
66 #if ! defined (JUCE_SILENCE_XCODE_15_LINKER_WARNING) \
67 && defined (__apple_build_version__) \
68 && __apple_build_version__ >= 15000000 \
69 && __apple_build_version__ < 15000100
70
71 // Due to known issues, the linker in Xcode 15.0 may produce broken binaries.
72 #error Please upgrade to Xcode 15.1 or higher
73 #endif
74
75 #define JUCE_CXX14_IS_AVAILABLE (__cplusplus >= 201402L)
76 #define JUCE_CXX17_IS_AVAILABLE (__cplusplus >= 201703L)
77
78#endif
79
80//==============================================================================
81// MSVC
82#if JUCE_MSVC
83
84 #if _MSC_FULL_VER < 191025017 // VS2017
85 #error "JUCE requires Visual Studio 2017 or later"
86 #endif
87
88 #ifndef JUCE_EXCEPTIONS_DISABLED
89 #if ! _CPPUNWIND
90 #define JUCE_EXCEPTIONS_DISABLED 1
91 #endif
92 #endif
93
94 #define JUCE_CXX14_IS_AVAILABLE (_MSVC_LANG >= 201402L)
95 #define JUCE_CXX17_IS_AVAILABLE (_MSVC_LANG >= 201703L)
96#endif
97
98//==============================================================================
99#if ! JUCE_CXX17_IS_AVAILABLE
100 #error "JUCE requires C++17 or later"
101#endif
102
103//==============================================================================
104#ifndef DOXYGEN
105 // These are old flags that are now supported on all compatible build targets
106 #define JUCE_COMPILER_SUPPORTS_OVERRIDE_AND_FINAL 1
107 #define JUCE_COMPILER_SUPPORTS_VARIADIC_TEMPLATES 1
108 #define JUCE_COMPILER_SUPPORTS_INITIALIZER_LISTS 1
109 #define JUCE_COMPILER_SUPPORTS_NOEXCEPT 1
110 #define JUCE_DELETED_FUNCTION = delete
111 #define JUCE_CONSTEXPR constexpr
112 #define JUCE_NODISCARD [[nodiscard]]
113#endif