Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
AX_GCC_FUNC_ATTRIBUTE([warn_unused_result])
AX_GCC_FUNC_ATTRIBUTE([weak])
AX_GCC_FUNC_ATTRIBUTE([alias])
+AX_GCC_FUNC_ATTRIBUTE([noreturn])
AM_CONDITIONAL([GEN_ASM_OFFSETS], test "x$GEN_ASM_OFFSETS" = xyes)
name : '__attribute__((alias(...)))')
pre_args += '-DHAVE_FUNC_ATTRIBUTE_ALIAS'
endif
+if cc.compiles('int foo(void) __attribute__((__noreturn__));',
+ name : '__attribute__((__noreturn__))')
+ pre_args += '-DHAVE_FUNC_ATTRIBUTE_NORETURN'
+endif
# TODO: this is very incomplete
if ['linux', 'cygwin'].contains(host_machine.system())
#define ATTRIBUTE_RETURNS_NONNULL
#endif
+#ifdef HAVE_FUNC_ATTRIBUTE_NORETURN
+#define NORETURN __attribute__((__noreturn__))
+#else
+#define NORETURN
+#endif
+
#ifdef __cplusplus
/**
* Macro function that evaluates to true if T is a trivially