summaryrefslogtreecommitdiffstats
path: root/build/m4/ax_c_statement_expressions.m4
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2018-11-07 12:22:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2018-11-07 12:22:44 +0000
commit1e6c93250172946eeb38e94a92a1fd12c9d3011e (patch)
tree8ca5e16dfc7ad6b3bf2738ca0a48408a950f8f7e /build/m4/ax_c_statement_expressions.m4
parentUpdate watch file (diff)
downloadnetdata-1e6c93250172946eeb38e94a92a1fd12c9d3011e.tar.xz
netdata-1e6c93250172946eeb38e94a92a1fd12c9d3011e.zip
Merging upstream version 1.11.0+dfsg.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'build/m4/ax_c_statement_expressions.m4')
-rw-r--r--build/m4/ax_c_statement_expressions.m423
1 files changed, 23 insertions, 0 deletions
diff --git a/build/m4/ax_c_statement_expressions.m4 b/build/m4/ax_c_statement_expressions.m4
new file mode 100644
index 000000000..fb259e727
--- /dev/null
+++ b/build/m4/ax_c_statement_expressions.m4
@@ -0,0 +1,23 @@
+# AC_C_STMT_EXPR
+# -------------
+# Define HAVE_STMT_EXPR if compiler has statement expressions.
+AN_IDENTIFIER([_Generic], [AC_C_STMT_EXPR])
+AC_DEFUN([AC_C_STMT_EXPR],
+[AC_CACHE_CHECK([for statement expressions], ac_cv_c_stmt_expr,
+[AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[int
+ main (int argc, char **argv)
+ {
+ int x = ({ int y = 1; y; });
+ return x;
+ }
+ ]])],
+ [ac_cv_c_stmt_expr=yes],
+ [ac_cv_c_stmt_expr=no])])
+if test $ac_cv_c_stmt_expr = yes; then
+ AC_DEFINE([HAVE_STMT_EXPR], 1,
+ [Define to 1 if compiler supports statement expressions.])
+fi
+])# AC_C_STMT_EXPR
+