diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2018-12-17 17:06:20 +0300 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2018-12-18 04:04:50 +0300 |
commit | 36f76f424f410f1d0427a9df55a34d8485e2ec8e (patch) | |
tree | e6868341009448fc1d4c1dd782918dc75207ab73 /include | |
parent | 502e5b92ecb00d6993440ee82afb3c34657a8c7f (diff) |
Remove carriage return characters
Diffstat (limited to 'include')
-rw-r--r-- | include/compat/msvc/stdatomic.h | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/include/compat/msvc/stdatomic.h b/include/compat/msvc/stdatomic.h index 28fe40c..979ee2b 100644 --- a/include/compat/msvc/stdatomic.h +++ b/include/compat/msvc/stdatomic.h @@ -23,10 +23,10 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -
-#ifndef MSCVER_STDATOMIC_H_
-#define MSCVER_STDATOMIC_H_
-
+ +#ifndef MSCVER_STDATOMIC_H_ +#define MSCVER_STDATOMIC_H_ + #if !defined(__cplusplus) && defined(_MSC_VER) #pragma warning(push) @@ -37,34 +37,34 @@ # include_next <stdatomic.h> #else /* ! stdatomic.h */ -#include <windows.h>
-
-#include "common/attributes.h"
-
-typedef volatile LONG __declspec(align(32)) atomic_int;
-typedef volatile ULONG __declspec(align(32)) atomic_uint;
-
-typedef enum {
- memory_order_relaxed,
- memory_order_acquire
-} msvc_atomic_memory_order;
-
-#define atomic_init(p_a, v) do { *(p_a) = (v); } while(0)
-#define atomic_store(p_a, v) InterlockedExchange((LONG*)p_a, v)
-#define atomic_load(p_a) InterlockedCompareExchange((LONG*)p_a, 0, 0)
-#define atomic_load_explicit(p_a, mo) atomic_load(p_a)
-
-/*
- * TODO use a special call to increment/decrement
- * using InterlockedIncrement/InterlockedDecrement
- */
-#define atomic_fetch_add(p_a, inc) InterlockedExchangeAdd(p_a, inc)
-#define atomic_fetch_sub(p_a, dec) InterlockedExchangeAdd(p_a, -(dec))
-
-#endif /* ! stdatomic.h */
-
-#pragma warning(pop)
-
-#endif /* !defined(__cplusplus) && defined(_MSC_VER) */
-
-#endif /* MSCVER_STDATOMIC_H_ */
+#include <windows.h> + +#include "common/attributes.h" + +typedef volatile LONG __declspec(align(32)) atomic_int; +typedef volatile ULONG __declspec(align(32)) atomic_uint; + +typedef enum { + memory_order_relaxed, + memory_order_acquire +} msvc_atomic_memory_order; + +#define atomic_init(p_a, v) do { *(p_a) = (v); } while(0) +#define atomic_store(p_a, v) InterlockedExchange((LONG*)p_a, v) +#define atomic_load(p_a) InterlockedCompareExchange((LONG*)p_a, 0, 0) +#define atomic_load_explicit(p_a, mo) atomic_load(p_a) + +/* + * TODO use a special call to increment/decrement + * using InterlockedIncrement/InterlockedDecrement + */ +#define atomic_fetch_add(p_a, inc) InterlockedExchangeAdd(p_a, inc) +#define atomic_fetch_sub(p_a, dec) InterlockedExchangeAdd(p_a, -(dec)) + +#endif /* ! stdatomic.h */ + +#pragma warning(pop) + +#endif /* !defined(__cplusplus) && defined(_MSC_VER) */ + +#endif /* MSCVER_STDATOMIC_H_ */ |