Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions libc/src/__support/CPP/type_traits/is_constant_evaluated.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ namespace LIBC_NAMESPACE_DECL {
namespace cpp {

LIBC_INLINE constexpr bool is_constant_evaluated() {
#if LIBC_HAS_BUILTIN(__builtin_is_constant_evaluated)
return __builtin_is_constant_evaluated();
#else
return false;
#endif
}

} // namespace cpp
Expand Down
6 changes: 5 additions & 1 deletion libc/src/__support/RPC/rpc_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,17 @@
#ifndef LLVM_LIBC_SRC___SUPPORT_RPC_RPC_SERVER_H
#define LLVM_LIBC_SRC___SUPPORT_RPC_RPC_SERVER_H

#include "src/__support/macros/properties/compiler.h"

// Workaround for missing __has_builtin in < GCC 10.
#ifndef __has_builtin
#define __has_builtin(x) 0
#endif

// Workaround for missing __builtin_is_constant_evaluated in < GCC 10.
#ifndef __builtin_is_constant_evaluated
// Also this builtin is defined for GCC 9.
#if !(__has_builtin(__builtin_is_constant_evaluated) || \
(defined(LIBC_COMPILER_IS_GCC) && (LIBC_COMPILER_GCC_VER >= 900)))
#define __builtin_is_constant_evaluated(x) 0
#endif

Expand Down
6 changes: 0 additions & 6 deletions libc/src/__support/macros/attributes.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,4 @@
#define LIBC_PREFERED_TYPE(TYPE)
#endif

#ifndef __has_builtin
#define LIBC_HAS_BUILTIN(X) 0
#else
#define LIBC_HAS_BUILTIN(X) __has_builtin(X)
#endif

#endif // LLVM_LIBC_SRC___SUPPORT_MACROS_ATTRIBUTES_H
Loading