diff options
Diffstat (limited to 'source/blender/blenlib/BLI_utildefines.h')
-rw-r--r-- | source/blender/blenlib/BLI_utildefines.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/source/blender/blenlib/BLI_utildefines.h b/source/blender/blenlib/BLI_utildefines.h index 65e8dcdba4a..31852fa0f43 100644 --- a/source/blender/blenlib/BLI_utildefines.h +++ b/source/blender/blenlib/BLI_utildefines.h @@ -513,6 +513,17 @@ extern "C" { sizeof(*(struct_var)) - OFFSETOF_STRUCT(struct_var, member)); \ } (void)0 +/* defined + * in memory_utils.c for now. I do not know where we should put it actually... */ +#ifndef __BLI_MEMORY_UTILS_H__ +extern bool BLI_memory_is_zero(const void *arr, const size_t arr_size); +#endif + +#define MEMCMP_STRUCT_OFS_IS_ZERO(struct_var, member) \ + (BLI_memory_is_zero( \ + (char *)(struct_var) + OFFSETOF_STRUCT(struct_var, member), \ + sizeof(*(struct_var)) - OFFSETOF_STRUCT(struct_var, member))) + /* Warning-free macros for storing ints in pointers. Use these _only_ * for storing an int in a pointer, not a pointer in an int (64bit)! */ #define SET_INT_IN_POINTER(i) ((void *)(intptr_t)(i)) @@ -623,9 +634,9 @@ extern "C" { #else # if (defined(__APPLE__) && defined(__ppc__)) /* static inline __attribute__ here breaks osx ppc gcc42 build */ -# define BLI_INLINE static __attribute__((always_inline)) +# define BLI_INLINE static __attribute__((always_inline)) __attribute__((__unused__)) # else -# define BLI_INLINE static inline __attribute__((always_inline)) +# define BLI_INLINE static inline __attribute__((always_inline)) __attribute__((__unused__)) # endif #endif |