|
23 | 23 | ?MAKE:d_attribute_deprecated d_attribute_format d_attribute_malloc \
|
24 | 24 | d_attribute_nonnull d_attribute_noreturn d_attribute_pure \
|
25 | 25 | d_attribute_unused d_attribute_warn_unused_result \
|
26 |
| - d_printf_format_null: \ |
| 26 | + d_printf_format_null d_attribute_always_inline: \ |
27 | 27 | Myread Oldconfig cat cc ccflags rm Setvar contains i_stdlib run \
|
28 | 28 | i_inttypes
|
29 | 29 | ?MAKE: -pick add $@ %<
|
|
73 | 73 | ?S: compiler can know that certain functions have a return values
|
74 | 74 | ?S: that must not be ignored, such as malloc() or open().
|
75 | 75 | ?S:.
|
| 76 | +?S:d_attribute_always_inline: |
| 77 | +?S: This variable conditionally defines HASATTRIBUTE_ALWAYS_INLINE, |
| 78 | +?S: which indicates that the C compiler can know that certain |
| 79 | +?S: functions should always be inlined. |
| 80 | +?S:. |
76 | 81 | ?C:HASATTRIBUTE_FORMAT ~ %< (GNUC_ATTRIBUTE_CHECK):
|
77 | 82 | ?C: Can we handle GCC attribute for checking printf-style formats
|
78 | 83 | ?C:.
|
|
100 | 105 | ?C:HASATTRIBUTE_WARN_UNUSED_RESULT ~ %< (HASATTRIBUTE):
|
101 | 106 | ?C: Can we handle GCC attribute for warning on unused results
|
102 | 107 | ?C:.
|
| 108 | +?C:HASATTRIBUTE_ALWAYS_INLINE: |
| 109 | +?C: Can we handle GCC attribute for functions that should always be |
| 110 | +?C: inlined. |
| 111 | +?C:. |
103 | 112 | ?H:?%<:#$d_attribute_deprecated HASATTRIBUTE_DEPRECATED /**/
|
104 | 113 | ?H:?%<:#$d_attribute_format HASATTRIBUTE_FORMAT /**/
|
105 | 114 | ?H:?%<:#$d_printf_format_null PRINTF_FORMAT_NULL_OK /**/
|
|
109 | 118 | ?H:?%<:#$d_attribute_pure HASATTRIBUTE_PURE /**/
|
110 | 119 | ?H:?%<:#$d_attribute_unused HASATTRIBUTE_UNUSED /**/
|
111 | 120 | ?H:?%<:#$d_attribute_warn_unused_result HASATTRIBUTE_WARN_UNUSED_RESULT /**/
|
| 121 | +?H:?%<:#$d_attribute_always_inline HASATTRIBUTE_ALWAYS_INLINE /**/ |
112 | 122 | ?H:.
|
113 | 123 | ?F:!attrib !attrib.out !attrib.c
|
114 | 124 | ?LINT:set d_attribute_deprecated
|
|
120 | 130 | ?LINT:set d_attribute_pure
|
121 | 131 | ?LINT:set d_attribute_unused
|
122 | 132 | ?LINT:set d_attribute_warn_unused_result
|
| 133 | +?LINT:set d_attribute_always_inline |
123 | 134 | : Look for GCC-style attribute format
|
124 | 135 | case "$d_attribute_format" in
|
125 | 136 | '')
|
@@ -395,3 +406,31 @@ set d_attribute_warn_unused_result
|
395 | 406 | eval $setvar
|
396 | 407 | $rm -f attrib*
|
397 | 408 |
|
| 409 | +: Look for GCC-style attribute always_inline |
| 410 | +case "$d_attribute_always_inline" in |
| 411 | +'') |
| 412 | +echo " " |
| 413 | +echo "Checking whether your compiler can handle __attribute__((always_inline)) ..." >&4 |
| 414 | +$cat >attrib.c <<'EOCP' |
| 415 | +#include <stdio.h> |
| 416 | +static __inline__ __attribute__((always_inline)) int I_will_always_be_inlined(void); |
| 417 | +EOCP |
| 418 | +if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then |
| 419 | + if $contains 'warning' attrib.out >/dev/null 2>&1; then |
| 420 | + echo "Your C compiler doesn't support __attribute__((always_inline))." |
| 421 | + val="$undef" |
| 422 | + else |
| 423 | + echo "Your C compiler supports __attribute__((always_inline))." |
| 424 | + val="$define" |
| 425 | + fi |
| 426 | +else |
| 427 | + echo "Your C compiler doesn't seem to understand __attribute__ at all." |
| 428 | + val="$undef" |
| 429 | +fi |
| 430 | +;; |
| 431 | +*) val="$d_attribute_always_inline" ;; |
| 432 | +esac |
| 433 | +set d_attribute_always_inline |
| 434 | +eval $setvar |
| 435 | +$rm -f attrib* |
| 436 | + |
0 commit comments