Skip to content

gcc-isms #16

Closed
Closed

Description

@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

Activity

  1. tudor commented on Oct 13, 2012

    @tudor
    Contributor

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

  2. asl commented on Oct 13, 2012

    @asl
    ContributorAuthor

    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
    
  3. asl commented on Oct 13, 2012

    @asl
    ContributorAuthor

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

  4. asl commented on Oct 13, 2012

    @asl
    ContributorAuthor

    But will provide some fixes soon :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions