1# @cc-check-inline
2#
3# The equivalent of the 'AC_C_INLINE' macro.
4#
5# defines 'HAVE_INLINE' if inline is available,
6# and defines 'inline' to be __inline__ or __inline if necessary
7# or to "" if not available.
8#
9# Returns 1 if 'inline' is available or 0 otherwise
10#
11proc cc-check-inline {} {
12	msg-checking "Checking for inline support..."
13	set ok 0
14	foreach i {inline __inline__ __inline} {
15		if {[cctest -declare "#ifndef __cplusplus\nstatic $i void testfunc__(void);\n#endif"]} {
16			incr ok
17			break
18		}
19	}
20	if {$ok} {
21		if {$i eq "inline"} {
22			msg-result yes
23		} else {
24			msg-result $i
25			define inline $i
26		}
27	} else {
28		define inline ""
29		msg-result no
30	}
31	define-feature inline $ok
32	return $ok
33}
34