mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-09 05:10:05 +02:00
33 lines
1.2 KiB
Plaintext
33 lines
1.2 KiB
Plaintext
From dfc4ae87b0acb62b1df85c212648b0fd63586d33 Mon Sep 17 00:00:00 2001
|
|
From: begasus <begasus@gmail.com>
|
|
Date: Wed, 6 Jul 2022 13:02:42 +0200
|
|
Subject: Revert upstream commit:
|
|
https://github.com/libusb/libusb/commit/eed8a371ea53939096ba94d44001e0637d042572
|
|
|
|
|
|
diff --git a/libusb/libusbi.h b/libusb/libusbi.h
|
|
index b1fc88c..63ed314 100644
|
|
--- a/libusb/libusbi.h
|
|
+++ b/libusb/libusbi.h
|
|
@@ -103,12 +103,11 @@ typedef volatile LONG usbi_atomic_t;
|
|
#define usbi_atomic_inc(a) InterlockedIncrement((a))
|
|
#define usbi_atomic_dec(a) InterlockedDecrement((a))
|
|
#else
|
|
-#include <stdatomic.h>
|
|
-typedef atomic_long usbi_atomic_t;
|
|
-#define usbi_atomic_load(a) atomic_load((a))
|
|
-#define usbi_atomic_store(a, v) atomic_store((a), (v))
|
|
-#define usbi_atomic_inc(a) (atomic_fetch_add((a), 1) + 1)
|
|
-#define usbi_atomic_dec(a) (atomic_fetch_add((a), -1) - 1)
|
|
+typedef long usbi_atomic_t;
|
|
+#define usbi_atomic_load(a) __atomic_load_n((a), __ATOMIC_SEQ_CST)
|
|
+#define usbi_atomic_store(a, v) __atomic_store_n((a), (v), __ATOMIC_SEQ_CST)
|
|
+#define usbi_atomic_inc(a) __atomic_add_fetch((a), 1, __ATOMIC_SEQ_CST)
|
|
+#define usbi_atomic_dec(a) __atomic_sub_fetch((a), 1, __ATOMIC_SEQ_CST)
|
|
#endif
|
|
|
|
/* Internal abstractions for event handling and thread synchronization */
|
|
--
|
|
2.36.1
|
|
|