Commit 7ea8b939 authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook Github Bot 7

Fix Build: folly after replacing FOLLY_NORETURN

Summary:[Folly] Fix Build: `folly` after replacing `FOLLY_NORETURN`.

Problem 1:
* Clang does not treat `[[noreturn]]` and `__attribute__((__noreturn__))` as the same attribute. When a function is declared twice with the noreturn attribute, both declarations must use either the one syntax or the other; Clang fails if the two declarations mix-and-match. When both `folly/detail/FunctionalExcept.h` and gcc49's `bits/functexcept.h` are both included from the same source, they (now) mix-and-match the attribute syntaxes and Clang emits an error.
* `folly/detail/FunctionalExcept.h` should be included only when `bits/functexcept.h` is unavailable - somehow, both headers were being included.

We fix the latter problem and keep our `[[noreturn]]` syntax.

Found from WDT build failures in Travis CI.

Reviewed By: ldemailly

Differential Revision: D3089987

fb-gh-sync-id: 705a087fc2a9629739d6cedd8315d56111204e6d
shipit-source-id: 705a087fc2a9629739d6cedd8315d56111204e6d
parent 9895ee08
...@@ -459,7 +459,7 @@ if !HAVE_WEAK_SYMBOLS ...@@ -459,7 +459,7 @@ if !HAVE_WEAK_SYMBOLS
libfollybase_la_SOURCES += detail/MallocImpl.cpp libfollybase_la_SOURCES += detail/MallocImpl.cpp
endif endif
if !HAVE_BITS_FUNCTEXCEPT if !HAVE_BITS_FUNCTEXCEPT_H
libfollybase_la_SOURCES += detail/FunctionalExcept.cpp libfollybase_la_SOURCES += detail/FunctionalExcept.cpp
endif endif
......
...@@ -528,7 +528,7 @@ AM_CONDITIONAL([RUN_ARCH_SPECIFIC_TESTS], [test "$build_cpu" = "x86_64" || test ...@@ -528,7 +528,7 @@ AM_CONDITIONAL([RUN_ARCH_SPECIFIC_TESTS], [test "$build_cpu" = "x86_64" || test
AM_CONDITIONAL([HAVE_LINUX], [test "$build_os" == "linux-gnu"]) AM_CONDITIONAL([HAVE_LINUX], [test "$build_os" == "linux-gnu"])
AM_CONDITIONAL([HAVE_WEAK_SYMBOLS], AM_CONDITIONAL([HAVE_WEAK_SYMBOLS],
[test "$folly_cv_prog_cc_weak_symbols" = "yes"]) [test "$folly_cv_prog_cc_weak_symbols" = "yes"])
AM_CONDITIONAL([HAVE_BITS_FUNCTEXCEPT], [test "$ac_cv_header_bits_functexcept_h" = "yes"]) AM_CONDITIONAL([HAVE_BITS_FUNCTEXCEPT_H], [test "$ac_cv_header_bits_functexcept_h" = "yes"])
AM_CONDITIONAL([HAVE_EXTRANDOM_SFMT19937], AM_CONDITIONAL([HAVE_EXTRANDOM_SFMT19937],
[test "$folly_cv_prog_cc_have_extrandom_sfmt19937" = "yes"]) [test "$folly_cv_prog_cc_have_extrandom_sfmt19937" = "yes"])
AM_CONDITIONAL([FOLLY_TESTMAIN], [test "x${use_follytestmain}" = "xyes"]) AM_CONDITIONAL([FOLLY_TESTMAIN], [test "x${use_follytestmain}" = "xyes"])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment