]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Fix __thread configure check on Clang
authorVictor Julien <victor@inliniac.net>
Wed, 2 Jul 2014 14:35:41 +0000 (16:35 +0200)
committerVictor Julien <victor@inliniac.net>
Wed, 2 Jul 2014 15:13:42 +0000 (17:13 +0200)
AC_TRY_COMPILE puts the code in a function already, and Clang didn't like
the function within the function declaration. This lead to test failure.

Clang now properly detects __thread support.

configure.ac

index 67d316b761e600310732cb2cd160aa595d3f5217..f15e07b70be5d63cbe30a8e79f267ad642452550 100644 (file)
     # check if our target supports thread local storage
     AC_MSG_CHECKING(for thread local storage __thread support)
     AC_TRY_COMPILE([#include <stdlib.h>],
-        [ void somefunc (void) { static __thread int i; i = 1; i++; } ],
+        [ static __thread int i; i = 1; i++; ],
         [AC_DEFINE([TLS], [1], [Thread local storage])
          AC_MSG_RESULT([yes]) ],
         [AC_MSG_RESULT([no])])