diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-11-19 17:35:49 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-11-19 17:47:31 +0300 |
commit | 92ea28101725631f8ebe6c6cfd37007175f1af03 (patch) | |
tree | 2bb078b2f4f1c72a9e7dace2aa07d8185c8c4a29 /source/blender/blenlib/BLI_utildefines.h | |
parent | d2b03d23647197f933d7afdeb53da35ed074bf94 (diff) |
Cleanup: remove BKE_utildefines
This was meant to be used for less general macros but was never used.
Rename BKE_BIT_TEST_SET to SET_FLAG_FROM_TEST
Diffstat (limited to 'source/blender/blenlib/BLI_utildefines.h')
-rw-r--r-- | source/blender/blenlib/BLI_utildefines.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_utildefines.h b/source/blender/blenlib/BLI_utildefines.h index b13d5e368ec..8f8d7cc3b7f 100644 --- a/source/blender/blenlib/BLI_utildefines.h +++ b/source/blender/blenlib/BLI_utildefines.h @@ -509,6 +509,16 @@ extern bool BLI_memory_is_zero(const void *arr, const size_t arr_size); #define SET_UINT_IN_POINTER(i) ((void *)(uintptr_t)(i)) #define GET_UINT_FROM_POINTER(i) ((void)0, ((unsigned int)(uintptr_t)(i))) +/* Set flag from a single test */ +#define SET_FLAG_FROM_TEST(value, test, flag) \ +{ \ + if (test) { \ + (value) |= (flag); \ + } \ + else { \ + (value) &= ~(flag); \ + } \ +} ((void)0) /* Macro to convert a value to string in the preprocessor * STRINGIFY_ARG: gives the argument as a string |