Skip to content


Subversion checkout URL

You can clone with
Download ZIP


gcc-isms #16

asl opened this Issue · 4 comments

3 participants


folly contains a decent amount of gcc'isms. Let me enumerate some of them:

  1. Portability.h uses __GNUC_PREREQ macro, which is basically available only on gcc and only after features.h is included.

  2. Several headers include stuff from bits/* which is definitely no-go, since it contains libstdc++ internal stuff and might now be available on, e.g. libc++-only system


Yes it does. Making folly portable outside of gcc 4.6+, Linux x86_64 has never been an explicit goal. We would welcome patches, though :)


Fix for Portability.h is simple:

diff --git a/folly/Portability.h b/folly/Portability.h
index 6d373a2..a9e8d32 100644
--- a/folly/Portability.h
+++ b/folly/Portability.h
@@ -33,7 +33,11 @@

-#ifdef __GNUC__
+#if defined(__clang__)
+#  define FOLLY_FINAL final
+#  define FOLLY_OVERRIDE override
+#elif defined(__GNUC__)
+# include <features.h>
 # if __GNUC_PREREQ(4,7)
 #  define FOLLY_FINAL final
 #  define FOLLY_OVERRIDE override

(sorry, no pull request, I have heavily hacked tree around)


But will provide some fixes soon :)

@jdelong jdelong closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.