* SOFTWARE.
*/
-/* The following really assume we have a 486 or better. */
+/* The following really assume we have a 486 or better. */
/* If ASSUME_WINDOWS98 is defined, we assume Windows 98 or newer. */
+/* If ASSUME_VISTA is defined, we assume Windows Server 2003, Vista */
+/* or later. */
#include "../all_aligned_atomic_load_store.h"
#define _InterlockedIncrement InterlockedIncrement
#define _InterlockedDecrement InterlockedDecrement
#define _InterlockedExchange InterlockedExchange
+#define _InterlockedExchangeAdd InterlockedExchangeAdd
#define _InterlockedCompareExchange InterlockedCompareExchange
#else
# error wrong architecture
#endif
+#ifdef ASSUME_VISTA
+/* NEC LE-IT: whenever we run on a pentium class machine we have that
+ * certain function */
+
+#include "../standard_ao_double_t.h"
+#pragma intrinsic (_InterlockedCompareExchange64)
+/* Returns nonzero if the comparison succeeded. */
+AO_INLINE int
+AO_compare_double_and_swap_double_full(volatile AO_double_t *addr,
+ AO_t old_val1, AO_t old_val2,
+ AO_t new_val1, AO_t new_val2)
+{
+ __int64 oldv = (__int64)old_val2 | ((__int64)old_val1 << 32);
+ __int64 newv = (__int64)new_val2 | ((__int64)new_val1 << 32);
+ return _InterlockedCompareExchange64((__int64 volatile *)addr,
+ newv, oldv) == oldv;
+}
+#define AO_HAVE_compare_double_and_swap_double_full
+
+#ifdef __cplusplus
+AO_INLINE int
+AO_compare_double_and_swap_double_full(volatile AO_double_t *addr,
+ AO_double_t old_val,
+ AO_double_t new_val)
+{
+ return _InterlockedCompareExchange64((__int64 volatile *)addr,
+ new_val.AO_whole, old_val.AO_whole) == old_val.AO_whole;
+}
+#define AO_HAVE_double_compare_and_swap_full
+#endif // __cplusplus
+#endif /* ASSUME_VISTA */
+
#include "../ao_t_is_int.h"