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:
authorCampbell Barton <ideasman42@gmail.com>2014-08-01 15:59:42 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-08-01 16:03:03 +0400
commit7f32cf46054ceb924afcfef4ebf7c26822aa524d (patch)
treeacb49bfe2dcf6cac95fbac2e39f657d1f7255248 /source/blender/blenlib
parentc9366a29693082555c1388717d7a99c08da5477c (diff)
Prevent macros hiding casts from `const` pointers
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r--source/blender/blenlib/BLI_utildefines.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_utildefines.h b/source/blender/blenlib/BLI_utildefines.h
index 564b31f974a..5937880665d 100644
--- a/source/blender/blenlib/BLI_utildefines.h
+++ b/source/blender/blenlib/BLI_utildefines.h
@@ -174,10 +174,16 @@
(void)__tmp; \
}))
+#define CHECK_TYPE_NONCONST(var) { \
+ void *non_const = ((__typeof(var))NULL); \
+ (void)non_const; \
+} (void)0
+
#else
# define CHECK_TYPE(var, type)
# define CHECK_TYPE_PAIR(var_a, var_b)
# define CHECK_TYPE_PAIR_INLINE(var_a, var_b) (void)0
+# define CHECK_TYPE_NONCONST(var) (void)0
#endif
/* can be used in simple macros */