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-07-17 04:11:43 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-07-17 05:56:08 +0400
commit7f4735ab3bfdc2e6647e132b36c919f390f52438 (patch)
tree62343c683fe4cd75853117813ece5ba2aad52cbe /source/blender/python/bmesh/bmesh_py_types.h
parenta798e01dc3ffa212689af6a340cf51bc74f2816f (diff)
bmesh py api: BPY_BM_CHECK_SOURCE_* macro now accepts multiple args
Diffstat (limited to 'source/blender/python/bmesh/bmesh_py_types.h')
-rw-r--r--source/blender/python/bmesh/bmesh_py_types.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/source/blender/python/bmesh/bmesh_py_types.h b/source/blender/python/bmesh/bmesh_py_types.h
index 86fa61d5f7e..a2c2c312e71 100644
--- a/source/blender/python/bmesh/bmesh_py_types.h
+++ b/source/blender/python/bmesh/bmesh_py_types.h
@@ -175,7 +175,7 @@ char *BPy_BMElem_StringFromHType(const char htype);
// void bpy_bm_generic_invalidate(BPy_BMGeneric *self);
int bpy_bm_generic_valid_check(BPy_BMGeneric *self);
-int bpy_bm_generic_valid_check_source(BPy_BMGeneric *self, BMesh *bm_source, const char *error_prefix);
+int bpy_bm_generic_valid_check_source(BMesh *bm_source, const char *error_prefix, void **args, unsigned int args_n) ATTR_NONNULL(1, 2);
#define BPY_BM_CHECK_OBJ(obj) \
if (UNLIKELY(bpy_bm_generic_valid_check((BPy_BMGeneric *)obj) == -1)) { return NULL; } (void)0
@@ -183,10 +183,18 @@ int bpy_bm_generic_valid_check_source(BPy_BMGeneric *self, BMesh *bm_source, co
if (UNLIKELY(bpy_bm_generic_valid_check((BPy_BMGeneric *)obj) == -1)) { return -1; } (void)0
/* macros like BPY_BM_CHECK_OBJ/BPY_BM_CHECK_INT that ensure we're from the right BMesh */
-#define BPY_BM_CHECK_SOURCE_OBJ(obj, bm, errmsg) \
- if (UNLIKELY(bpy_bm_generic_valid_check_source((BPy_BMGeneric *)obj, bm, errmsg) == -1)) { return NULL; } (void)0
-#define BPY_BM_CHECK_SOURCE_INT(obj, bm, errmsg) \
- if (UNLIKELY(bpy_bm_generic_valid_check_source((BPy_BMGeneric *)obj, bm, errmsg) == -1)) { return -1; } (void)0
+#define BPY_BM_CHECK_SOURCE_OBJ(bm, errmsg, ...) { \
+ void *_args[] = {__VA_ARGS__}; \
+ if (UNLIKELY(bpy_bm_generic_valid_check_source(bm, errmsg, _args, ARRAY_SIZE(_args)) == -1)) { \
+ return NULL; \
+ } \
+} (void)0
+#define BPY_BM_CHECK_SOURCE_INT(bm, errmsg, ...) { \
+ void *_args[] = {__VA_ARGS__}; \
+ if (UNLIKELY(bpy_bm_generic_valid_check_source(bm, errmsg, _args, ARRAY_SIZE(_args)) == -1)) { \
+ return -1; \
+ } \
+} (void)0
#define BPY_BM_IS_VALID(obj) (LIKELY((obj)->bm != NULL))