|
From: Jeremy F. <je...@go...> - 2005-01-17 23:19:13
|
CVS commit by fitzhardinge:
Check that the compiler supports __thread before trying to use it.
A tls.h 1.1 [no copyright]
M +11 -0 tls.c 1.2
M +4 -0 tls2.c 1.2
M +4 -0 tls2_so.c 1.2
M +5 -1 tls_so.c 1.2
--- valgrind/none/tests/tls.c #1.1:1.2
@@ -4,4 +4,8 @@
#include <time.h>
+#include "tls.h"
+
+#ifdef HAVE_TLS
+
#define COUNT 10
@@ -100,2 +104,9 @@ int main()
return 0;
}
+#else
+int main()
+{
+ printf("FAILED: no compiler support for __thread\n");
+ return 1;
+}
+#endif
--- valgrind/none/tests/tls2.c #1.1:1.2
@@ -1 +1,5 @@
+#include "tls.h"
+
+#ifdef HAVE_TLS
__thread int static_extern;
+#endif
--- valgrind/none/tests/tls2_so.c #1.1:1.2
@@ -1 +1,5 @@
+#include "tls.h"
+
+#ifdef HAVE_TLS
__thread int so_extern;
+#endif
--- valgrind/none/tests/tls_so.c #1.1:1.2
@@ -1,2 +1,5 @@
+#include "tls.h"
+
+#ifdef HAVE_TLS
#include <pthread.h>
@@ -19,2 +22,3 @@ int *test_so_global(void)
return &global;
}
+#endif
|