From ff0470d28a0875454f59fd6c87da0907d68ff6df Mon Sep 17 00:00:00 2001 From: Petro Karashchenko Date: Tue, 5 Apr 2022 11:19:17 +0200 Subject: [PATCH] include/nuttx: remove double definitions of UNUSED macro Signed-off-by: Petro Karashchenko --- include/nuttx/compiler.h | 34 +++++++++++++--------------------- 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/include/nuttx/compiler.h b/include/nuttx/compiler.h index 3772cf23d0..286530ea48 100644 --- a/include/nuttx/compiler.h +++ b/include/nuttx/compiler.h @@ -47,10 +47,6 @@ # define CONFIG_HAVE_FUNCTIONNAME 1 /* Has __FUNCTION__ */ # define CONFIG_HAVE_FILENAME 1 /* Has __FILE__ */ -/* Indicate that a local variable is not used */ - -# define UNUSED(a) ((void)(1 || (a))) - /* Built-in functions */ /* The header shall define the following macros: @@ -537,10 +533,6 @@ # undef CONFIG_HAVE_DOUBLE # undef CONFIG_HAVE_LONG_DOUBLE -/* Indicate that a local variable is not used */ - -# define UNUSED(a) ((void)(1 || (a))) - # define offsetof(a, b) ((size_t)(&(((a *)(0))->b))) # define no_builtin(n) @@ -668,6 +660,10 @@ # undef CONFIG_HAVE_ANONYMOUS_STRUCT # undef CONFIG_HAVE_ANONYMOUS_UNION +/* Indicate that a local variable is not used */ + +# define UNUSED(a) ((void)(1 || (a))) + /* Older Zilog compilers support both types double and long long, but the * size is 32-bits (same as long and single precision) so it is safer to say * that they are not supported. Later versions are more ANSII compliant and @@ -679,10 +675,6 @@ # undef CONFIG_HAVE_DOUBLE # undef CONFIG_HAVE_LONG_DOUBLE -/* Indicate that a local variable is not used */ - -# define UNUSED(a) ((void)(1 || (a))) - # define offsetof(a, b) ((size_t)(&(((a *)(0))->b))) # define no_builtin(n) @@ -691,14 +683,6 @@ #elif defined(__ICCARM__) -# define CONFIG_CPP_HAVE_VARARGS 1 /* Supports variable argument macros */ -# define CONFIG_HAVE_FILENAME 1 /* Has __FILE__ */ -# define CONFIG_HAVE_FLOAT 1 - -/* Indicate that a local variable is not used */ - -# define UNUSED(a) ((void)(1 || (a))) - # define weak_alias(name, aliasname) # define weak_data __weak # define weak_function __weak @@ -754,6 +738,14 @@ # undef CONFIG_HAVE_ANONYMOUS_STRUCT # undef CONFIG_HAVE_ANONYMOUS_UNION +/* Indicate that a local variable is not used */ + +# define UNUSED(a) ((void)(1 || (a))) + +# define CONFIG_CPP_HAVE_VARARGS 1 /* Supports variable argument macros */ +# define CONFIG_HAVE_FILENAME 1 /* Has __FILE__ */ +# define CONFIG_HAVE_FLOAT 1 + # define offsetof(a, b) ((size_t)(&(((a *)(0))->b))) # define no_builtin(n) @@ -767,7 +759,7 @@ # undef CONFIG_HAVE_FUNCTIONNAME # undef CONFIG_HAVE_FILENAME # undef CONFIG_HAVE_WEAKFUNCTIONS -# undef CONFIG_HAVE_CXX14 +# undef CONFIG_HAVE_CXX14 # define weak_alias(name, aliasname) # define weak_data # define weak_function