• Stephan Hartmann's avatar
    GCC: fix __has_builtin defines for non-clang compilers · 9d518a68
    Stephan Hartmann authored
    Defining __has_builtin to 0 for non-clang compilers in base headers can
    lead to wrong detection of features. For example in base/location.h
    checking for __has_builtin macros succeeds for non-clang compilers,
    because base/check_op.h defines __has_builtin to 0 and is included
    before base/location.h. Instead of defining __has_builtin to 0 for
    non-clang compilers, define an independent preprocessor symbol that
    reflects support for requested feature. Undefine the symbol to avoid
    collision.
    
    While we're at it fix base/memory/aligned_memory.h too.
    
    Bug: 819294
    Change-Id: Iac40dc44e7356b600e7d06aa4ccd1294bb09ebce
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2224252Reviewed-by: default avatarFrançois Doray <fdoray@chromium.org>
    Commit-Queue: François Doray <fdoray@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#773784}
    9d518a68
aligned_memory.h 2.4 KB