Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

gcc-isms #16

Closed
asl opened this Issue · 4 comments

3 participants

@asl

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

@tudor
Collaborator

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 :)

@asl

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 @@
 #undef FOLLY_FINAL
 #undef FOLLY_OVERRIDE

-#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
@asl

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

@asl

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.