Qt5 has a wrapper macro that makes __has_include simpler to use:
#ifdef __has_include # define QT_HAS_INCLUDE(x) __has_include(x) #else # define QT_HAS_INCLUDE(x) 0 #endif #if QT_HAS_INCLUDE(<chrono>) # include <chrono> #endif
The code handling this so far ignores macros entirely. This patch makes -frewrite-includes rewrite all #if/#elif conditions, which is more reliable and simpler than trying to handle __has_include specifically.