Use _Static_assert() if available
[fio.git] / configure
index e5cf34d68a87fbb4c18e8d5c218e5766679eae2c..2e859c7a7e4e915f245ac939c23659d8cd571a7a 100755 (executable)
--- a/configure
+++ b/configure
@@ -1511,6 +1511,21 @@ if compile_prog "" "" "__sync_fetch_and_add"; then
 fi
 echo "__sync_fetch_and_add          $sfa"
 
+##########################################
+# Check whether we have _Static_assert
+static_assert="no"
+cat > $TMPC << EOF
+#include <assert.h>
+int main(int argc, char **argv)
+{
+  _Static_assert( 1 == 1 , "Check");
+  return 0 ;
+}
+EOF
+if compile_prog "" "" "static_assert"; then
+    static_assert="yes"
+fi
+echo "Static Assert                 $static_assert"
 #############################################################################
 
 if test "$wordsize" = "64" ; then
@@ -1693,6 +1708,9 @@ fi
 if test "$sfa" = "yes" ; then
   output_sym "CONFIG_SFA"
 fi
+if test "$static_assert" = "yes" ; then
+  output_sym "CONFIG_STATIC_ASSERT"
+fi
 
 if test "$zlib" = "no" ; then
   echo "Consider installing zlib-dev (zlib-devel), some fio features depend on it."