Make subthreadcreate test compilable even without libatomic_ops
authorIvan Maidanski <ivmai@mail.ru>
Tue, 29 May 2018 18:01:23 +0000 (21:01 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 29 May 2018 18:02:43 +0000 (21:02 +0300)
(fix of commit 4becbc906)

* tests/subthread_create.c [HAVE_CONFIG_H]: Update comment.
* tests/subthread_create.c: Do not include gc.h and gc_atomic_ops.h
(and do not define AO_REQUIRE_CAS) unless GC_THREADS is defined.

tests/subthread_create.c

index 5d9c831..7c9a3cc 100644 (file)
@@ -1,18 +1,17 @@
 
 #ifdef HAVE_CONFIG_H
-  /* For PARALLEL_MARK */
+  /* For GC_THREADS and PARALLEL_MARK */
 # include "config.h"
 #endif
 
-#ifndef GC_THREADS
-# define GC_THREADS
-#endif
-#include "gc.h"
+#ifdef GC_THREADS
+# include "gc.h"
 
-#ifdef PARALLEL_MARK
-# define AO_REQUIRE_CAS
-#endif
-#include "private/gc_atomic_ops.h"
+# ifdef PARALLEL_MARK
+#   define AO_REQUIRE_CAS
+# endif
+# include "private/gc_atomic_ops.h"
+#endif /* GC_THREADS */
 
 #include <stdio.h>