Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 10:08:49

0001 // Copyright 2020 the V8 project authors. All rights reserved.
0002 // Use of this source code is governed by a BSD-style license that can be
0003 // found in the LICENSE file.
0004 
0005 #ifndef INCLUDE_CPPGC_INTERNAL_COMPILER_SPECIFIC_H_
0006 #define INCLUDE_CPPGC_INTERNAL_COMPILER_SPECIFIC_H_
0007 
0008 namespace cppgc {
0009 
0010 #if defined(__has_attribute)
0011 #define CPPGC_HAS_ATTRIBUTE(FEATURE) __has_attribute(FEATURE)
0012 #else
0013 #define CPPGC_HAS_ATTRIBUTE(FEATURE) 0
0014 #endif
0015 
0016 #if defined(__has_cpp_attribute)
0017 #define CPPGC_HAS_CPP_ATTRIBUTE(FEATURE) __has_cpp_attribute(FEATURE)
0018 #else
0019 #define CPPGC_HAS_CPP_ATTRIBUTE(FEATURE) 0
0020 #endif
0021 
0022 // [[no_unique_address]] comes in C++20 but supported in clang with -std >=
0023 // c++11.
0024 #if CPPGC_HAS_CPP_ATTRIBUTE(no_unique_address)
0025 #define CPPGC_NO_UNIQUE_ADDRESS [[no_unique_address]]
0026 #else
0027 #define CPPGC_NO_UNIQUE_ADDRESS
0028 #endif
0029 
0030 #if CPPGC_HAS_ATTRIBUTE(unused)
0031 #define CPPGC_UNUSED __attribute__((unused))
0032 #else
0033 #define CPPGC_UNUSED
0034 #endif
0035 
0036 }  // namespace cppgc
0037 
0038 #endif  // INCLUDE_CPPGC_INTERNAL_COMPILER_SPECIFIC_H_