diff --git a/src/native/minipal/utils.h b/src/native/minipal/utils.h index d4f6a149afca36..ef840a529f48f7 100644 --- a/src/native/minipal/utils.h +++ b/src/native/minipal/utils.h @@ -17,12 +17,15 @@ #define __has_attribute(x) 0 #endif -#ifndef __has_cpp_attribute -#define __has_cpp_attribute(x) 0 -#endif - -#if defined(__cplusplus) && __has_cpp_attribute(fallthrough) -# define FALLTHROUGH [[fallthrough]] +#ifdef __cplusplus +# ifndef __has_cpp_attribute +# define __has_cpp_attribute(x) 0 +# endif +# if __has_cpp_attribute(fallthrough) +# define FALLTHROUGH [[fallthrough]] +# else +# define FALLTHROUGH +# endif #elif __has_attribute(fallthrough) # define FALLTHROUGH __attribute__((fallthrough)) #else