zephyr/include/toolchain/llvm.h
Daniel Leung fb92a654e3 toolchain: introduce macro TOOLCHAIN_HAS_C_AUTO_TYPE
This introduces the macro TOOLCHAIN_HAS_C_AUTO_TYPE to
indicate that the toolchain supports __auto_type. This is
supported since GCC 4.9.0 and Clang 3.8.0.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-02-28 10:52:51 +01:00

32 lines
637 B
C

/*
* Copyright (c) 2021 Intel Corporation.
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_INCLUDE_TOOLCHAIN_LLVM_H_
#define ZEPHYR_INCLUDE_TOOLCHAIN_LLVM_H_
#define __no_optimization __attribute__((optnone))
#if __clang_major__ >= 10
#define __fallthrough __attribute__((fallthrough))
#endif
#define CLANG_VERSION \
((__clang_major__ * 10000) + (__clang_minor__ * 100) + \
__clang_patchlevel__)
#define TOOLCHAIN_HAS_PRAGMA_DIAG 1
#if CLANG_VERSION >= 30800
#define TOOLCHAIN_HAS_C_GENERIC 1
#define TOOLCHAIN_HAS_C_AUTO_TYPE 1
#endif
#include <toolchain/gcc.h>
#endif /* ZEPHYR_INCLUDE_TOOLCHAIN_LLVM_H_ */