mirror of
https://github.com/neovim/neovim.git
synced 2025-10-04 17:06:30 +00:00
refactor: move function macros out of vim_defs.h (#26300)
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include <stdint.h> // IWYU pragma: keep
|
||||
#include <time.h> // IWYU pragma: keep
|
||||
|
||||
#include "auto/config.h"
|
||||
#include "nvim/macros_defs.h"
|
||||
#include "nvim/memory_defs.h" // IWYU pragma: export
|
||||
|
||||
@@ -57,3 +58,17 @@ EXTERN size_t arena_alloc_count INIT( = 0);
|
||||
*ptr_ = NULL; \
|
||||
(void)(*ptr_); \
|
||||
} while (0)
|
||||
|
||||
#define CLEAR_FIELD(field) memset(&(field), 0, sizeof(field))
|
||||
#define CLEAR_POINTER(ptr) memset((ptr), 0, sizeof(*(ptr)))
|
||||
|
||||
#ifndef HAVE_STRNLEN
|
||||
# define strnlen xstrnlen // Older versions of SunOS may not have strnlen
|
||||
#endif
|
||||
|
||||
#define STRCPY(d, s) strcpy((char *)(d), (char *)(s)) // NOLINT(runtime/printf)
|
||||
|
||||
// Like strcpy() but allows overlapped source and destination.
|
||||
#define STRMOVE(d, s) memmove((d), (s), strlen(s) + 1)
|
||||
|
||||
#define STRCAT(d, s) strcat((char *)(d), (char *)(s)) // NOLINT(runtime/printf)
|
||||
|
Reference in New Issue
Block a user