Changeset: b83670df92e9 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/b83670df92e9
Modified Files:
common/utils/matomic.h
Branch: default
Log Message:
Make sure ATOMIC_TYPE and ATOMIC_BASE_TYPE are compatible.
diffs (48 lines):
diff --git a/common/utils/matomic.h b/common/utils/matomic.h
--- a/common/utils/matomic.h
+++ b/common/utils/matomic.h
@@ -57,7 +57,6 @@
/* #define NO_ATOMIC_INSTRUCTIONS */
/* the atomic type we export is always a 64 bit unsigned integer */
-typedef uint64_t ATOMIC_BASE_TYPE;
/* ignore __STDC_NO_ATOMICS__ if compiling using Intel compiler on
* Windows since otherwise we can't compile this at all in C99 mode */
@@ -67,8 +66,10 @@ typedef uint64_t ATOMIC_BASE_TYPE;
#if SIZEOF_LONG_LONG == 8
typedef volatile atomic_ullong ATOMIC_TYPE;
+typedef unsigned long long ATOMIC_BASE_TYPE;
#elif SIZEOF_LONG == 8
typedef volatile atomic_ulong ATOMIC_TYPE;
+typedef unsigned long ATOMIC_BASE_TYPE;
#else
#error "we need a 64 bit atomic type"
#endif
@@ -106,6 +107,8 @@ typedef volatile atomic_flag ATOMIC_FLAG
#elif defined(_MSC_VER) && !defined(NO_ATOMIC_INSTRUCTIONS)
+typedef uint64_t ATOMIC_BASE_TYPE;
+
#include <intrin.h>
/* On Windows, with Visual Studio 2005, the compiler uses acquire
@@ -227,6 +230,7 @@ typedef volatile int ATOMIC_FLAG;
/* the new way of doing this according to GCC (the old way, using
* __sync_* primitives is not supported) */
+typedef uint64_t ATOMIC_BASE_TYPE;
typedef volatile ATOMIC_BASE_TYPE ATOMIC_TYPE;
#define ATOMIC_VAR_INIT(val) (val)
@@ -262,6 +266,8 @@ typedef volatile char ATOMIC_FLAG;
/* emulate using mutexes */
+typedef uint64_t ATOMIC_BASE_TYPE;
+
#include <pthread.h> /* required for pthread_mutex_t */
typedef struct {
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list