pkarashchenko commented on code in PR #6482: URL: https://github.com/apache/incubator-nuttx/pull/6482#discussion_r906658298
########## include/nuttx/compiler.h: ########## @@ -69,6 +69,36 @@ # undef CONFIG_HAVE_CXX14 #endif +#if defined(__cplusplus) && __cplusplus >= 201703L +# define CONFIG_HAVE_CXX17 1 +#else +# undef CONFIG_HAVE_CXX17 +#endif + + +/* Check for intrinsics */ +#ifdef __has_builtin +# if __has_builtin(__builtin_bswap16) +# define CONFIG_HAVE_BUILTIN_BSWAP16 1 +# endif +# if __has_builtin(__builtin_bswap32) +# define CONFIG_HAVE_BUILTIN_BSWAP32 1 +# endif +# if __has_builtin(__builtin_bswap64) && defined(CONFIG_HAVE_LONG_LONG) +# define CONFIG_HAVE_BUILTIN_BSWAP64 1 +# endif +# if __has_builtin(__builtin_ctz) +# define CONFIG_HAVE_BUILTIN_CTZ 1 +# endif +# if __has_builtin(__builtin_clz) +# define CONFIG_HAVE_BUILTIN_CLZ 1 +# endif +# if __has_builtin(__builtin_popcount) +# define CONFIG_HAVE_BUILTIN_POPCOUNT 1 +# endif +#endif Review Comment: Yes. For Clang you can even redefine `__GNUC__` to a desired value, so with compiler option you can reach the desired functionality. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org