aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/func_attr.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/func_attr.h')
-rw-r--r--src/nvim/func_attr.h27
1 files changed, 11 insertions, 16 deletions
diff --git a/src/nvim/func_attr.h b/src/nvim/func_attr.h
index 15370dcb3e..d638fda531 100644
--- a/src/nvim/func_attr.h
+++ b/src/nvim/func_attr.h
@@ -1,24 +1,16 @@
-// If DEFINE_FUNC_ATTRIBUTES macro is not defined then all function attributes
-// are defined as empty values.
-//
-// If DO_NOT_DEFINE_EMPTY_ATTRIBUTES then empty macros are not defined. Thus
-// undefined DEFINE_FUNC_ATTRIBUTES and defined DO_NOT_DEFINE_EMPTY_ATTRIBUTES
+// Undefined DEFINE_FUNC_ATTRIBUTES and undefined DEFINE_EMPTY_ATTRIBUTES
// leaves file with untouched FUNC_ATTR_* macros. This variant is used for
-// scripts/gendeclarations.lua.
+// scripts/gen_declarations.lua.
//
-// Empty macros are used for *.c files. (undefined DEFINE_FUNC_ATTRIBUTES and
-// undefined DO_NOT_DEFINE_EMPTY_ATTRIBUTES)
+// Empty macros are used for *.c files.
+// (undefined DEFINE_FUNC_ATTRIBUTES and defined DEFINE_EMPTY_ATTRIBUTES)
//
// Macros defined as __attribute__((*)) are used by generated header files.
-// (defined DEFINE_FUNC_ATTRIBUTES and undefined
-// DO_NOT_DEFINE_EMPTY_ATTRIBUTES)
-//
-// Defined DEFINE_FUNC_ATTRIBUTES and defined DO_NOT_DEFINE_EMPTY_ATTRIBUTES is
-// not used by anything.
+// (defined DEFINE_FUNC_ATTRIBUTES and undefined DEFINE_EMPTY_ATTRIBUTES)
// FUNC_ATTR_* macros should be in *.c files for declarations generator. If you
// define a function for which declaration is not generated by
-// gendeclarations.lua (e.g. template hash implementation) then you should use
+// gen_declarations.lua (e.g. template hash implementation) then you should use
// REAL_FATTR_* macros.
// gcc and clang expose their version as follows:
@@ -217,7 +209,7 @@
# endif
#endif
-#ifdef DEFINE_FUNC_ATTRIBUTES
+#if defined(DEFINE_FUNC_ATTRIBUTES) || defined(DEFINE_EMPTY_ATTRIBUTES)
/// Fast (non-deferred) API function.
# define FUNC_API_FAST
/// Internal C function not exposed in the RPC API.
@@ -234,6 +226,9 @@
# define FUNC_API_SINCE(X)
/// API function deprecated since the given API level.
# define FUNC_API_DEPRECATED_SINCE(X)
+#endif
+
+#if defined(DEFINE_FUNC_ATTRIBUTES)
# define FUNC_ATTR_MALLOC REAL_FATTR_MALLOC
# define FUNC_ATTR_ALLOC_SIZE(x) REAL_FATTR_ALLOC_SIZE(x)
# define FUNC_ATTR_ALLOC_SIZE_PROD(x, y) REAL_FATTR_ALLOC_SIZE_PROD(x, y)
@@ -250,7 +245,7 @@
# define FUNC_ATTR_NO_SANITIZE_UNDEFINED REAL_FATTR_NO_SANITIZE_UNDEFINED
# define FUNC_ATTR_NO_SANITIZE_ADDRESS REAL_FATTR_NO_SANITIZE_ADDRESS
# define FUNC_ATTR_PRINTF(x, y) REAL_FATTR_PRINTF(x, y)
-#elif !defined(DO_NOT_DEFINE_EMPTY_ATTRIBUTES)
+#elif defined(DEFINE_EMPTY_ATTRIBUTES)
# define FUNC_ATTR_MALLOC
# define FUNC_ATTR_ALLOC_SIZE(x)
# define FUNC_ATTR_ALLOC_SIZE_PROD(x, y)