Debian Codegraph @

include/ruby/internal/compiler_is/apple.h

raw
1 #ifndef RBIMPL_COMPILER_IS_APPLE_H /*-*-C++-*-vi:se ft=cpp:*/
2 #define RBIMPL_COMPILER_IS_APPLE_H
3 /**
4 * @author Ruby developers <[email protected]>
5 * @copyright This file is a part of the programming language Ruby.
6 * Permission is hereby granted, to either redistribute and/or
7 * modify this file, provided that the conditions mentioned in the
8 * file COPYING are met. Consult the file for details.
9 * @warning Symbols prefixed with either `RBIMPL` or `rbimpl` are
10 * implementation details. Don't take them as canon. They could
11 * rapidly appear then vanish. The name (path) of this header file
12 * is also an implementation detail. Do not expect it to persist
13 * at the place it is now. Developers are free to move it anywhere
14 * anytime at will.
15 * @note To ruby-core: remember that this header can be possibly
16 * recursively included from extension libraries written in C++.
17 * Do not expect for instance `__VA_ARGS__` is always available.
18 * We assume C99 for ruby itself but we don't assume languages of
19 * extension libraries. They could be written in C++98.
20 * @brief Defines RBIMPL_COMPILER_IS_Apple.
21 *
22 * Apple ships clang. Problem is, its `__clang_major__` etc. are not the
23 * upstream LLVM version, but XCode's. We have to think Apple's is distinct
24 * from LLVM's, when it comes to compiler detection business in this header
25 * file.
26 */
27 #if ! defined(__clang__)
28 # define RBIMPL_COMPILER_IS_Apple 0
29
30 #elif ! defined(__apple_build_version__)
31 # define RBIMPL_COMPILER_IS_Apple 0
32
33 #else
34 # define RBIMPL_COMPILER_IS_Apple 1
35 # define RBIMPL_COMPILER_VERSION_MAJOR __clang_major__
36 # define RBIMPL_COMPILER_VERSION_MINOR __clang_minor__
37 # define RBIMPL_COMPILER_VERSION_PATCH __clang_patchlevel__
38 #endif
39
40 #endif /* RBIMPL_COMPILER_IS_APPLE_H */