diff options
author | Sybren A. Stüvel <sybren@stuvel.eu> | 2018-04-08 15:07:34 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@stuvel.eu> | 2018-04-08 15:07:34 +0300 |
commit | a981206fd183355bdcc8331b3a74ce3d382e1f67 (patch) | |
tree | efa5534ed691645530707a80cf4a2039909f79b7 /source/blender/blenlib | |
parent | 0b5ebb3265b155658d441135e152f32ba11c001d (diff) | |
parent | 245e01c30ac296c509e04f702c6b5d76086265b5 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/BLI_string_utf8.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_string_utf8.h b/source/blender/blenlib/BLI_string_utf8.h index 32504a88b48..21542d0d6e1 100644 --- a/source/blender/blenlib/BLI_string_utf8.h +++ b/source/blender/blenlib/BLI_string_utf8.h @@ -77,6 +77,16 @@ size_t BLI_str_partition_ex_utf8( #define BLI_UTF8_WIDTH_MAX 2 /* columns */ #define BLI_UTF8_ERR ((unsigned int)-1) +/** \name String Copy/Format Macros + * Avoid repeating destination with `sizeof(..)`. + * \note `ARRAY_SIZE` allows pointers on some platforms. + * \{ */ +#define STRNCPY_UTF8(dst, src) \ + BLI_strncpy_utf8(dst, src, ARRAY_SIZE(dst)) +#define STRNCPY_UTF8_RLEN(dst, src) \ + BLI_strncpy_utf8_rlen(dst, src, ARRAY_SIZE(dst)) +/** \} */ + #ifdef __cplusplus } #endif |