Unconditionally cast ref to volatile long on win32;
This was originally a C++-only contribution, but clang also warns
about it on windows when compiling as C.
It's nice to have one less thing specific to C++.
@@ -17,18 +17,12 @@ static inline uint32_t ref_dec(Ref* ref) { return --*ref; }
#elif defined(_MSC_VER)
-#ifdef __cplusplus
-#define _LOVR_REF_H_CPP_CAST (volatile long *)
-#else
-#define _LOVR_REF_H_CPP_CAST
-#endif
-
// MSVC atomics
#include <intrin.h>
typedef uint32_t Ref;
-static inline uint32_t ref_inc(Ref* ref) { return _InterlockedIncrement(_LOVR_REF_H_CPP_CAST ref); }
-static inline uint32_t ref_dec(Ref* ref) { return _InterlockedDecrement(_LOVR_REF_H_CPP_CAST ref); }
+static inline uint32_t ref_inc(Ref* ref) { return _InterlockedIncrement((volatile long*) ref); }
+static inline uint32_t ref_dec(Ref* ref) { return _InterlockedDecrement((volatile long*) ref); }
#elif (defined(__GNUC_MINOR__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7))) \
|| (__has_builtin(__atomic_add_fetch) && __has_builtin(__atomic_sub_fetch))
