QT编译时出现指示以下头文件有错误:
#if defined(__cplusplus)
#if __has_cpp_attribute(clang::fallthrough)
# define Q_FALLTHROUGH() [[clang::fallthrough]]
#elif __has_cpp_attribute(gnu::fallthrough)
# define Q_FALLTHROUGH() [[gnu::fallthrough]]
#elif __has_cpp_attribute(fallthrough)
# define Q_FALLTHROUGH() [[fallthrough]]
#endif
#endif
改为:
#if defined(__cplusplus)
#if defined(__clang__)
#if QT_HAS_CPP_ATTRIBUTE(clang::fallthrough)
# define Q_FALLTHROUGH() [[clang::fallthrough]]
#endif
#elif defined(__GNUC__)
#if QT_HAS_CPP_ATTRIBUTE(gnu::fallthrough)
# define Q_FALLTHROUGH() [[gnu::fallthrough]]
#endif
#elif QT_HAS_CPP_ATTRIBUTE(fallthrough)
# define Q_FALLTHROUGH() [[fallthrough]]
#endif
#endif
网友评论