diff options
Diffstat (limited to 'intern/libmv/intern/utildefines.h')
-rw-r--r-- | intern/libmv/intern/utildefines.h | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/intern/libmv/intern/utildefines.h b/intern/libmv/intern/utildefines.h index d76d32f9c4d..052052a1d76 100644 --- a/intern/libmv/intern/utildefines.h +++ b/intern/libmv/intern/utildefines.h @@ -30,27 +30,33 @@ # define LIBMV_OBJECT_NEW OBJECT_GUARDED_NEW # define LIBMV_OBJECT_DELETE OBJECT_GUARDED_DELETE # define LIBMV_OBJECT_DELETE OBJECT_GUARDED_DELETE -# define LIBMV_STRUCT_NEW(type, count) \ - (type*)MEM_mallocN(sizeof(type) * count, __func__) +# define LIBMV_STRUCT_NEW(type, count) \ + (type*)MEM_mallocN(sizeof(type) * count, __func__) # define LIBMV_STRUCT_DELETE(what) MEM_freeN(what) #else // Need this to keep libmv-capi potentially standalone. # if defined __GNUC__ || defined __sun -# define LIBMV_OBJECT_NEW(type, args ...) \ - new(malloc(sizeof(type))) type(args) +# define LIBMV_OBJECT_NEW(type, args...) \ + new (malloc(sizeof(type))) type(args) # else -# define LIBMV_OBJECT_NEW(type, ...) \ - new(malloc(sizeof(type))) type(__VA_ARGS__) -#endif -# define LIBMV_OBJECT_DELETE(what, type) \ - { \ - if (what) { \ - ((type*)(what))->~type(); \ - free(what); \ - } \ - } (void)0 +# define LIBMV_OBJECT_NEW(type, ...) \ + new (malloc(sizeof(type))) type(__VA_ARGS__) +# endif +# define LIBMV_OBJECT_DELETE(what, type) \ + { \ + if (what) { \ + ((type*)(what))->~type(); \ + free(what); \ + } \ + } \ + (void)0 # define LIBMV_STRUCT_NEW(type, count) (type*)malloc(sizeof(type) * count) -# define LIBMV_STRUCT_DELETE(what) { if (what) free(what); } (void)0 +# define LIBMV_STRUCT_DELETE(what) \ + { \ + if (what) \ + free(what); \ + } \ + (void)0 #endif #endif // LIBMV_C_API_UTILDEFINES_H_ |