diff --git a/src/nouveau/winsys/nouveau_bo.h b/src/nouveau/winsys/nouveau_bo.h index 8787474254c..cf9f9506daf 100644 --- a/src/nouveau/winsys/nouveau_bo.h +++ b/src/nouveau/winsys/nouveau_bo.h @@ -5,8 +5,19 @@ #include "nouveau_device.h" +#ifdef __cplusplus +#include +using std::atomic_uint_fast32_t; +#else +#include +#endif + #include +#ifdef __cplusplus +extern "C" { +#endif + enum nouveau_ws_bo_flags { /* vram or gart depending on GPU */ NOUVEAU_WS_BO_LOCAL = 0 << 0, @@ -27,7 +38,7 @@ struct nouveau_ws_bo { int fd; uint32_t handle; enum nouveau_ws_bo_flags flags; - _Atomic uint32_t refcnt; + atomic_uint_fast32_t refcnt; }; struct nouveau_ws_bo *nouveau_ws_bo_new(struct nouveau_ws_device *, @@ -54,4 +65,8 @@ nouveau_ws_bo_unmap(struct nouveau_ws_bo *bo, void *ptr) munmap(ptr, bo->size); } +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/nouveau/winsys/nouveau_context.h b/src/nouveau/winsys/nouveau_context.h index e03b461bfef..cf2f7d05a15 100644 --- a/src/nouveau/winsys/nouveau_context.h +++ b/src/nouveau/winsys/nouveau_context.h @@ -3,6 +3,10 @@ #include "nouveau_private.h" +#ifdef __cplusplus +extern "C" { +#endif + struct nouveau_ws_device; struct nouveau_ws_object { @@ -25,4 +29,8 @@ int nouveau_ws_context_create(struct nouveau_ws_device *, struct nouveau_ws_cont bool nouveau_ws_context_killed(struct nouveau_ws_context *); void nouveau_ws_context_destroy(struct nouveau_ws_context *); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/nouveau/winsys/nouveau_device.h b/src/nouveau/winsys/nouveau_device.h index 7a9b1d29743..9833064884b 100644 --- a/src/nouveau/winsys/nouveau_device.h +++ b/src/nouveau/winsys/nouveau_device.h @@ -5,6 +5,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + enum nvk_debug { /* dumps all push buffers after submission */ NVK_DEBUG_PUSH_DUMP = 1ull << 0, @@ -61,4 +65,8 @@ struct nouveau_ws_device { struct nouveau_ws_device *nouveau_ws_device_new(int fd); void nouveau_ws_device_destroy(struct nouveau_ws_device *); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/nouveau/winsys/nouveau_push.h b/src/nouveau/winsys/nouveau_push.h index 1abd31c0d5a..fcc8921d9b0 100644 --- a/src/nouveau/winsys/nouveau_push.h +++ b/src/nouveau/winsys/nouveau_push.h @@ -1,11 +1,15 @@ -#ifndef NOUVEAU_CMD_BUF -#define NOUVEAU_CMD_BUF 1 +#ifndef NOUVEAU_PUSH +#define NOUVEAU_PUSH 1 #include "nouveau_private.h" #include "nouveau_bo.h" #include "util/u_dynarray.h" +#ifdef __cplusplus +extern "C" { +#endif + struct nouveau_ws_context; struct nouveau_ws_device; @@ -259,4 +263,8 @@ P_SPACE(struct nouveau_ws_push *push, uint32_t size) return nouveau_ws_push_space(push, size); } +#ifdef __cplusplus +} #endif + +#endif /* NOUVEAU_PUSH */