Commit f4f864ef authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook GitHub Bot

fix safe-assert test link failures without weak symbols

Reviewed By: luciang

Differential Revision: D27071414

fbshipit-source-id: 8bbe12e8f8264f2040c030e0353e1e4d59efae55
parent bda140dc
...@@ -23,16 +23,23 @@ ...@@ -23,16 +23,23 @@
#include <folly/lang/Keep.h> #include <folly/lang/Keep.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
extern "C" FOLLY_ATTR_WEAK void sink(); namespace folly {
namespace safe_assert_test {
template <typename... T>
FOLLY_ATTR_WEAK FOLLY_NOINLINE void sink(T&&...) {}
} // namespace safe_assert_test
} // namespace folly
extern "C" FOLLY_KEEP void check_folly_safe_check(bool cond) { extern "C" FOLLY_KEEP void check_folly_safe_check(bool cond) {
FOLLY_SAFE_CHECK(cond, "the condition failed"); FOLLY_SAFE_CHECK(cond, "the condition failed");
sink(); folly::safe_assert_test::sink();
} }
extern "C" FOLLY_KEEP void check_folly_safe_pcheck(bool cond) { extern "C" FOLLY_KEEP void check_folly_safe_pcheck(bool cond) {
FOLLY_SAFE_PCHECK(cond, "the condition failed"); FOLLY_SAFE_PCHECK(cond, "the condition failed");
sink(); folly::safe_assert_test::sink();
} }
// clang-format off // clang-format off
......
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