]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libcpp/system.h
libcpp: Use [[likely]] conditionally
[thirdparty/gcc.git] / libcpp / system.h
index ee5fbe288892dc502016ecfe51637cc896aa18a7..f6fc583ab806afe8edf93df2bb9d9b2f5c4f2c71 100644 (file)
@@ -422,6 +422,16 @@ extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN;
 #define gcc_checking_assert(EXPR) ((void)(0 && (EXPR)))
 #endif
 
+#ifdef __has_cpp_attribute
+# if __has_cpp_attribute(likely)
+#  define ATTR_LIKELY [[likely]]
+# elif __has_cpp_attribute(__likely__)
+#  define ATTR_LIKELY [[__likely__]]
+# else
+#  define ATTR_LIKELY
+# endif
+#endif
+
 /* Poison identifiers we do not want to use.  */
 #if (GCC_VERSION >= 3000)
 #undef calloc