From bb8c4485a2803c7873b275a2e732665633b394cb Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Fri, 27 Nov 2020 15:50:25 +0800 Subject: [PATCH] libc: Change OK/ERROR macro to enum to avoid the conflict with 3rd party c++ library(e.g. protobuf): https://github.com/protocolbuffers/protobuf/blob/fdc35840b95f56c3aef44a3fc6ae5991f21620a5/src/google/protobuf/stubs/status.h#L47 Signed-off-by: Xiang Xiao Change-Id: Ie8bb9008a8375c729f8b947c9f10baa80104d157 --- include/sys/types.h | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/include/sys/types.h b/include/sys/types.h index 4bc7b97045..ea46899c23 100644 --- a/include/sys/types.h +++ b/include/sys/types.h @@ -76,16 +76,6 @@ # endif #endif -/* POSIX-like OS return values: */ - -#if !defined(__cplusplus) -# undef ERROR -# define ERROR -1 -#endif - -#undef OK -#define OK 0 - /* Scheduling Priorities. * * NOTES: @@ -305,6 +295,14 @@ typedef uint64_t u_int64_t; typedef CODE int (*main_t)(int argc, FAR char *argv[]); +/* POSIX-like OS return values: */ + +enum +{ + ERROR = -1, + OK = 0, +}; + #endif /* __ASSEMBLY__ */ /****************************************************************************