LMMS
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__) < 500
34 #error "JUCE requires GCC 5.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__ < 3) || (__clang_major__ == 3 && __clang_minor__ < 4)
53 #error "JUCE requires Clang 3.4 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 #define JUCE_CXX14_IS_AVAILABLE (__cplusplus >= 201402L)
67 #define JUCE_CXX17_IS_AVAILABLE (__cplusplus >= 201703L)
68
69#endif
70
71//==============================================================================
72// MSVC
73#if JUCE_MSVC
74
75 #if _MSC_FULL_VER < 191025017 // VS2017
76 #error "JUCE requires Visual Studio 2017 or later"
77 #endif
78
79 #ifndef JUCE_EXCEPTIONS_DISABLED
80 #if ! _CPPUNWIND
81 #define JUCE_EXCEPTIONS_DISABLED 1
82 #endif
83 #endif
84
85 #define JUCE_CXX14_IS_AVAILABLE (_MSVC_LANG >= 201402L)
86 #define JUCE_CXX17_IS_AVAILABLE (_MSVC_LANG >= 201703L)
87#endif
88
89//==============================================================================
90#if ! JUCE_CXX14_IS_AVAILABLE
91 #error "JUCE requires C++14 or later"
92#endif
93
94//==============================================================================
95#ifndef DOXYGEN
96 // These are old flags that are now supported on all compatible build targets
97 #define JUCE_COMPILER_SUPPORTS_OVERRIDE_AND_FINAL 1
98 #define JUCE_COMPILER_SUPPORTS_VARIADIC_TEMPLATES 1
99 #define JUCE_COMPILER_SUPPORTS_INITIALIZER_LISTS 1
100 #define JUCE_COMPILER_SUPPORTS_NOEXCEPT 1
101 #define JUCE_DELETED_FUNCTION = delete
102 #define JUCE_CONSTEXPR constexpr
103#endif
104
105#if JUCE_CXX17_IS_AVAILABLE
106 #define JUCE_NODISCARD [[nodiscard]]
107#else
108 #define JUCE_NODISCARD
109#endif