Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGermano Cavalcante <germano.costa@ig.com.br>2021-04-30 17:20:39 +0300
committerGermano Cavalcante <germano.costa@ig.com.br>2021-04-30 17:20:39 +0300
commit2bd9a28ff8d7a7bcb5481b8f9e029959b8b055e8 (patch)
tree769b76c96d80d987e16f80bb307fa4cf87b3a5bb /source/blender/python
parenta711aa5b3c715da29546d860f4fde24c27e34593 (diff)
Cleanup: Rename `#if GPU_USE_PY_REFERENCES` to `#ifndef GPU_NO_USE_PY_REFERENCES`
This is safer for incremental build. And there was already a macro `GPU_USE_PY_REFERENCES` used elsewhere.
Diffstat (limited to 'source/blender/python')
-rw-r--r--source/blender/python/gpu/gpu_py_framebuffer.c6
-rw-r--r--source/blender/python/gpu/gpu_py_framebuffer.h2
-rw-r--r--source/blender/python/gpu/gpu_py_texture.c6
3 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/python/gpu/gpu_py_framebuffer.c b/source/blender/python/gpu/gpu_py_framebuffer.c
index 70938cf1ecc..adb3c485537 100644
--- a/source/blender/python/gpu/gpu_py_framebuffer.c
+++ b/source/blender/python/gpu/gpu_py_framebuffer.c
@@ -75,7 +75,7 @@ static void pygpu_framebuffer_free_if_possible(GPUFrameBuffer *fb)
static void pygpu_framebuffer_free_safe(BPyGPUFrameBuffer *self)
{
if (self->fb) {
-#if GPU_USE_PY_REFERENCES
+#ifndef GPU_NO_USE_PY_REFERENCES
GPU_framebuffer_py_reference_set(self->fb, NULL);
if (!self->shared_reference)
#endif
@@ -639,7 +639,7 @@ PyObject *BPyGPUFrameBuffer_CreatePyObject(GPUFrameBuffer *fb, bool shared_refer
{
BPyGPUFrameBuffer *self;
-#if GPU_USE_PY_REFERENCES
+#ifndef GPU_NO_USE_PY_REFERENCES
if (shared_reference) {
void **ref = GPU_framebuffer_py_reference_get(fb);
if (ref) {
@@ -657,7 +657,7 @@ PyObject *BPyGPUFrameBuffer_CreatePyObject(GPUFrameBuffer *fb, bool shared_refer
self = PyObject_New(BPyGPUFrameBuffer, &BPyGPUFrameBuffer_Type);
self->fb = fb;
-#if GPU_USE_PY_REFERENCES
+#ifndef GPU_NO_USE_PY_REFERENCES
self->shared_reference = shared_reference;
BLI_assert(GPU_framebuffer_py_reference_get(fb) == NULL);
diff --git a/source/blender/python/gpu/gpu_py_framebuffer.h b/source/blender/python/gpu/gpu_py_framebuffer.h
index 0049cc2fac7..6727328518c 100644
--- a/source/blender/python/gpu/gpu_py_framebuffer.h
+++ b/source/blender/python/gpu/gpu_py_framebuffer.h
@@ -29,7 +29,7 @@ extern PyTypeObject BPyGPUFrameBuffer_Type;
typedef struct BPyGPUFrameBuffer {
PyObject_HEAD struct GPUFrameBuffer *fb;
-#if GPU_USE_PY_REFERENCES
+#ifndef GPU_NO_USE_PY_REFERENCES
bool shared_reference;
#endif
} BPyGPUFrameBuffer;
diff --git a/source/blender/python/gpu/gpu_py_texture.c b/source/blender/python/gpu/gpu_py_texture.c
index 9cc6a9df8fa..7e0a642dbbc 100644
--- a/source/blender/python/gpu/gpu_py_texture.c
+++ b/source/blender/python/gpu/gpu_py_texture.c
@@ -412,7 +412,7 @@ static PyObject *pygpu_texture_free(BPyGPUTexture *self)
static void BPyGPUTexture__tp_dealloc(BPyGPUTexture *self)
{
if (self->tex) {
-#if GPU_USE_PY_REFERENCES
+#ifndef GPU_NO_USE_PY_REFERENCES
GPU_texture_py_reference_set(self->tex, NULL);
#endif
GPU_texture_free(self->tex);
@@ -600,7 +600,7 @@ PyObject *BPyGPUTexture_CreatePyObject(GPUTexture *tex, bool shared_reference)
BPyGPUTexture *self;
if (shared_reference) {
-#if GPU_USE_PY_REFERENCES
+#ifndef GPU_NO_USE_PY_REFERENCES
void **ref = GPU_texture_py_reference_get(tex);
if (ref) {
/* Retrieve BPyGPUTexture reference. */
@@ -617,7 +617,7 @@ PyObject *BPyGPUTexture_CreatePyObject(GPUTexture *tex, bool shared_reference)
self = PyObject_New(BPyGPUTexture, &BPyGPUTexture_Type);
self->tex = tex;
-#if GPU_USE_PY_REFERENCES
+#ifndef GPU_NO_USE_PY_REFERENCES
BLI_assert(GPU_texture_py_reference_get(tex) == NULL);
GPU_texture_py_reference_set(tex, &self->tex);
#endif