#include "pipe/p_compiler.h"
#include "pipe/p_defines.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
/* Favor OS-provided implementations.
*
* Where no OS-provided implementation is available, fall back to
#define PIPE_ATOMIC "GCC x86 assembly"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define p_atomic_set(_v, _i) (*(_v) = (_i))
#define p_atomic_read(_v) (*(_v))
-
static INLINE boolean
p_atomic_dec_zero(int32_t *v)
{
{
return __sync_val_compare_and_swap(v, old, _new);
}
+
+#ifdef __cplusplus
+}
+#endif
+
#endif
#define PIPE_ATOMIC "GCC Sync Intrinsics"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define p_atomic_set(_v, _i) (*(_v) = (_i))
#define p_atomic_read(_v) (*(_v))
-
static INLINE boolean
p_atomic_dec_zero(int32_t *v)
{
{
return __sync_val_compare_and_swap(v, old, _new);
}
+
+#ifdef __cplusplus
+}
+#endif
+
#endif
#define PIPE_ATOMIC "MSVC x86 assembly"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define p_atomic_set(_v, _i) (*(_v) = (_i))
#define p_atomic_read(_v) (*(_v))
return orig;
}
+
+#ifdef __cplusplus
+}
+#endif
+
#endif
#pragma intrinsic(_InterlockedDecrement)
#pragma intrinsic(_InterlockedCompareExchange)
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define p_atomic_set(_v, _i) (*(_v) = (_i))
#define p_atomic_read(_v) (*(_v))
return _InterlockedCompareExchange(v, _new, old);
}
+#ifdef __cplusplus
+}
+#endif
+
#endif
-#ifdef __cplusplus
-}
-#endif
-
#endif /* U_ATOMIC_H */
#define U_BLIT_H
+#include "pipe/p_defines.h"
+#include "util/u_debug.h"
+
#ifdef __cplusplus
extern "C" {
#endif
-#include "pipe/p_defines.h"
-#include "util/u_debug.h"
-
static INLINE boolean u_validate_pipe_prim( unsigned pipe_prim, unsigned nr )
{
boolean ok = TRUE;