util: Don't include system headers inside extern "C" { ... }
That breaks when some of the system headers have C++ code.
This commit is contained in:
parent
45dac0d82a
commit
e0da333d6b
|
@ -12,11 +12,6 @@
|
||||||
#include "pipe/p_compiler.h"
|
#include "pipe/p_compiler.h"
|
||||||
#include "pipe/p_defines.h"
|
#include "pipe/p_defines.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* Favor OS-provided implementations.
|
/* Favor OS-provided implementations.
|
||||||
*
|
*
|
||||||
* Where no OS-provided implementation is available, fall back to
|
* Where no OS-provided implementation is available, fall back to
|
||||||
|
@ -44,10 +39,13 @@ extern "C" {
|
||||||
|
|
||||||
#define PIPE_ATOMIC "GCC x86 assembly"
|
#define PIPE_ATOMIC "GCC x86 assembly"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
#define p_atomic_set(_v, _i) (*(_v) = (_i))
|
#define p_atomic_set(_v, _i) (*(_v) = (_i))
|
||||||
#define p_atomic_read(_v) (*(_v))
|
#define p_atomic_read(_v) (*(_v))
|
||||||
|
|
||||||
|
|
||||||
static INLINE boolean
|
static INLINE boolean
|
||||||
p_atomic_dec_zero(int32_t *v)
|
p_atomic_dec_zero(int32_t *v)
|
||||||
{
|
{
|
||||||
|
@ -76,6 +74,11 @@ p_atomic_cmpxchg(int32_t *v, int32_t old, int32_t _new)
|
||||||
{
|
{
|
||||||
return __sync_val_compare_and_swap(v, old, _new);
|
return __sync_val_compare_and_swap(v, old, _new);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -86,10 +89,13 @@ p_atomic_cmpxchg(int32_t *v, int32_t old, int32_t _new)
|
||||||
|
|
||||||
#define PIPE_ATOMIC "GCC Sync Intrinsics"
|
#define PIPE_ATOMIC "GCC Sync Intrinsics"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
#define p_atomic_set(_v, _i) (*(_v) = (_i))
|
#define p_atomic_set(_v, _i) (*(_v) = (_i))
|
||||||
#define p_atomic_read(_v) (*(_v))
|
#define p_atomic_read(_v) (*(_v))
|
||||||
|
|
||||||
|
|
||||||
static INLINE boolean
|
static INLINE boolean
|
||||||
p_atomic_dec_zero(int32_t *v)
|
p_atomic_dec_zero(int32_t *v)
|
||||||
{
|
{
|
||||||
|
@ -113,6 +119,11 @@ p_atomic_cmpxchg(int32_t *v, int32_t old, int32_t _new)
|
||||||
{
|
{
|
||||||
return __sync_val_compare_and_swap(v, old, _new);
|
return __sync_val_compare_and_swap(v, old, _new);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -140,6 +151,10 @@ p_atomic_cmpxchg(int32_t *v, int32_t old, int32_t _new)
|
||||||
|
|
||||||
#define PIPE_ATOMIC "MSVC x86 assembly"
|
#define PIPE_ATOMIC "MSVC x86 assembly"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
#define p_atomic_set(_v, _i) (*(_v) = (_i))
|
#define p_atomic_set(_v, _i) (*(_v) = (_i))
|
||||||
#define p_atomic_read(_v) (*(_v))
|
#define p_atomic_read(_v) (*(_v))
|
||||||
|
|
||||||
|
@ -190,6 +205,11 @@ p_atomic_cmpxchg(int32_t *v, int32_t old, int32_t _new)
|
||||||
|
|
||||||
return orig;
|
return orig;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -203,6 +223,10 @@ p_atomic_cmpxchg(int32_t *v, int32_t old, int32_t _new)
|
||||||
#pragma intrinsic(_InterlockedDecrement)
|
#pragma intrinsic(_InterlockedDecrement)
|
||||||
#pragma intrinsic(_InterlockedCompareExchange)
|
#pragma intrinsic(_InterlockedCompareExchange)
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
#define p_atomic_set(_v, _i) (*(_v) = (_i))
|
#define p_atomic_set(_v, _i) (*(_v) = (_i))
|
||||||
#define p_atomic_read(_v) (*(_v))
|
#define p_atomic_read(_v) (*(_v))
|
||||||
|
|
||||||
|
@ -230,6 +254,10 @@ p_atomic_cmpxchg(int32_t *v, int32_t old, int32_t _new)
|
||||||
return _InterlockedCompareExchange(v, _new, old);
|
return _InterlockedCompareExchange(v, _new, old);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -240,8 +268,4 @@ p_atomic_cmpxchg(int32_t *v, int32_t old, int32_t _new)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* U_ATOMIC_H */
|
#endif /* U_ATOMIC_H */
|
||||||
|
|
|
@ -30,13 +30,13 @@
|
||||||
#define U_BLIT_H
|
#define U_BLIT_H
|
||||||
|
|
||||||
|
|
||||||
|
#include "pipe/p_defines.h"
|
||||||
|
#include "util/u_debug.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "pipe/p_defines.h"
|
|
||||||
#include "util/u_debug.h"
|
|
||||||
|
|
||||||
static INLINE boolean u_validate_pipe_prim( unsigned pipe_prim, unsigned nr )
|
static INLINE boolean u_validate_pipe_prim( unsigned pipe_prim, unsigned nr )
|
||||||
{
|
{
|
||||||
boolean ok = TRUE;
|
boolean ok = TRUE;
|
||||||
|
|
Loading…
Reference in New Issue