Ruby  3.1.0dev(2021-09-10revisionb76ad15ed0da636161de0243c547ee1e6fc95681)
feature.h
Go to the documentation of this file.
1 #ifndef BIGDECIMAL_HAS_FEATURE_H
2 #define BIGDECIMAL_HAS_FEATURE_H
3 
4 /* ======== __has_feature ======== */
5 
6 #ifndef __has_feature
7 # define __has_feature(_) 0
8 #endif
9 
10 /* ======== __has_extension ======== */
11 
12 #ifndef __has_extension
13 # define __has_extension __has_feature
14 #endif
15 
16 /* ======== __has_builtin ======== */
17 
18 #ifdef HAVE_RUBY_INTERNAL_HAS_BUILTIN_H
20 #endif
21 
22 #ifdef RBIMPL_HAS_BUILTIN
23 # define BIGDECIMAL_HAS_BUILTIN(...) RBIMPL_HAS_BUILTIN(__VA_ARGS__)
24 
25 #else
26 # /* The following section is copied from CRuby's builtin.h */
27 #
28 # ifdef __has_builtin
29 # if defined(__INTEL_COMPILER)
30 # /* :TODO: Intel C Compiler has __has_builtin (since 19.1 maybe?), and is
31 # * reportedly broken. We have to skip them. However the situation can
32 # * change. They might improve someday. We need to revisit here later. */
33 # elif defined(__GNUC__) && ! __has_builtin(__builtin_alloca)
34 # /* FreeBSD's <sys/cdefs.h> defines its own *broken* version of
35 # * __has_builtin. Cygwin copied that content to be a victim of the
36 # * broken-ness. We don't take them into account. */
37 # else
38 # define HAVE___HAS_BUILTIN 1
39 # endif
40 # endif
41 #
42 # if defined(HAVE___HAS_BUILTIN)
43 # define BIGDECIMAL_HAS_BUILTIN(_) __has_builtin(_)
44 #
45 # elif defined(__GNUC__)
46 # define BIGDECIMAL_HAS_BUILTIN(_) BIGDECIMAL_HAS_BUILTIN_ ## _
47 # if defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 6))
48 # define BIGDECIMAL_HAS_BUILTIN___builtin_clz 1
49 # define BIGDECIMAL_HAS_BUILTIN___builtin_clzl 1
50 # else
51 # define BIGDECIMAL_HAS_BUILTIN___builtin_clz 0
52 # define BIGDECIMAL_HAS_BUILTIN___builtin_clzl 0
53 # endif
54 # elif defined(_MSC_VER)
55 # define BIGDECIMAL_HAS_BUILTIN(_) 0
56 #
57 # else
58 # define BIGDECIMAL_HAS_BUILTIN(_) BIGDECIMAL_HAS_BUILTIN_ ## _
59 # define BIGDECIMAL_HAS_BUILTIN___builtin_clz HAVE_BUILTIN___BUILTIN_CLZ
60 # define BIGDECIMAL_HAS_BUILTIN___builtin_clzl HAVE_BUILTIN___BUILTIN_CLZL
61 # endif
62 #endif /* RBIMPL_HAS_BUILTIN */
63 
64 #ifndef __has_builtin
65 # define __has_builtin(...) BIGDECIMAL_HAS_BUILTIN(__VA_ARGS__)
66 #endif
67 
68 #endif /* BIGDECIMAL_HAS_FEATURE_H */
builtin.h
Defines RBIMPL_HAS_BUILTIN.