aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/memory.h
diff options
context:
space:
mode:
authorZyX <kp-pav@ya.ru>2014-05-10 17:24:13 +0400
committerThiago de Arruda <tpadilha84@gmail.com>2014-06-02 11:04:17 -0300
commit70929f7e1616bab2783cc5735c6061981cda8a0f (patch)
tree4a947af96fa0bac749f843a41e7b6593dd2659c0 /src/nvim/memory.h
parent880957ad4e3fc0ff681025f5e29c5eccf797c564 (diff)
downloadrneovim-70929f7e1616bab2783cc5735c6061981cda8a0f.tar.gz
rneovim-70929f7e1616bab2783cc5735c6061981cda8a0f.tar.bz2
rneovim-70929f7e1616bab2783cc5735c6061981cda8a0f.zip
Add automatic generation of headers
- The 'stripdecls.py' script replaces declarations in all headers by includes to generated headers. `ag '#\s*if(?!ndef NEOVIM_).*((?!#\s*endif).*\n)*#ifdef INCLUDE_GENERATED'` was used for this. - Add and integrate gendeclarations.lua into the build system to generate the required includes. - Add -Wno-unused-function - Made a bunch of old-style definitions ANSI This adds a requirement: all type and structure definitions must be present before INCLUDE_GENERATED_DECLARATIONS-protected include. Warning: mch_expandpath (path.h.generated.h) was moved manually. So far it is the only exception.
Diffstat (limited to 'src/nvim/memory.h')
-rw-r--r--src/nvim/memory.h41
1 files changed, 4 insertions, 37 deletions
diff --git a/src/nvim/memory.h b/src/nvim/memory.h
index fc3b4ac52b..3a05797e89 100644
--- a/src/nvim/memory.h
+++ b/src/nvim/memory.h
@@ -1,43 +1,10 @@
#ifndef NVIM_MEMORY_H
#define NVIM_MEMORY_H
-#include "nvim/func_attr.h"
-#include "nvim/types.h"
+#include <stddef.h>
#include "nvim/vim.h"
-void *try_malloc(size_t size) FUNC_ATTR_MALLOC FUNC_ATTR_ALLOC_SIZE(1);
-
-void *verbose_try_malloc(size_t size) FUNC_ATTR_MALLOC FUNC_ATTR_ALLOC_SIZE(1);
-
-void *xmalloc(size_t size)
- FUNC_ATTR_MALLOC FUNC_ATTR_ALLOC_SIZE(1) FUNC_ATTR_NONNULL_RET;
-
-void *xcalloc(size_t count, size_t size)
- FUNC_ATTR_MALLOC FUNC_ATTR_ALLOC_SIZE_PROD(1, 2) FUNC_ATTR_NONNULL_RET;
-
-void *xrealloc(void *ptr, size_t size)
- FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_ALLOC_SIZE(2) FUNC_ATTR_NONNULL_RET;
-
-void *xmallocz(size_t size) FUNC_ATTR_MALLOC FUNC_ATTR_NONNULL_RET;
-
-void *xmemdupz(const void *data, size_t len) FUNC_ATTR_NONNULL_RET;
-
-char * xstrdup(const char *str)
- FUNC_ATTR_MALLOC FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_RET;
-
-char * xstrndup(const char *str, size_t len)
- FUNC_ATTR_MALLOC FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_RET;
-
-char *xstpcpy(char *restrict dst, const char *restrict src);
-
-char *xstpncpy(char *restrict dst, const char *restrict src, size_t maxlen);
-
-size_t xstrlcpy(char *restrict dst, const char *restrict src, size_t size);
-
-void *xmemdup(const void *data, size_t len)
- FUNC_ATTR_MALLOC FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_RET;
-
-void do_outofmem_msg(size_t size);
-void free_all_mem(void);
-
+#ifdef INCLUDE_GENERATED_DECLARATIONS
+# include "memory.h.generated.h"
#endif
+#endif // NVIM_MEMORY_H