From 5b1511ca57a1b140791d19f994ad835c91ffa15f Mon Sep 17 00:00:00 2001 From: fef Date: Wed, 21 Jul 2021 22:23:46 +0200 Subject: [PATCH] toolchain: refactor __restrict c++ compat macro --- include/neo/_string.h | 4 ++-- include/neo/_toolchain.h | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/include/neo/_string.h b/include/neo/_string.h index 0e8f5b9..5985199 100644 --- a/include/neo/_string.h +++ b/include/neo/_string.h @@ -43,7 +43,7 @@ struct _neo_nstr_init_info { * @param err: Error pointer * @returns The converted string, unless an error occurred */ -string *nstr(const char *__restrict s, error *err); +string *nstr(const char *restrict s, error *err); /** * Copy a regular C string to a neo string, but at most `maxsize` bytes. @@ -57,7 +57,7 @@ string *nstr(const char *__restrict s, error *err); * @param err: Error pointer * @returns The converted string, unless an error occurred */ -string *nnstr(const char *__restrict s, usize maxsize, error *err); +string *nnstr(const char *restrict s, usize maxsize, error *err); /** * Get the Unicode code point in a string at the specified index. diff --git a/include/neo/_toolchain.h b/include/neo/_toolchain.h index 0cc4e2c..a5199ca 100644 --- a/include/neo/_toolchain.h +++ b/include/neo/_toolchain.h @@ -19,9 +19,7 @@ __neo_section(.fini_array) void (*__neo_fini_##fn)(void) = fn #ifdef __cplusplus -# define __restrict -#else -# define __restrict restrict +# define restrict #endif /*