Commit c60784b8 authored by Keith Daigle's avatar Keith Daigle Committed by Facebook Github Bot

Make FOLLY_HAS_COROUTINES dependent on header

Summary:
This breaks while building on aarch64 each time because the headers aren't
in the repo. I did a quick grep and I don't see anything in folly that
uses OptionalAwaitable or OptionalPromise so perhaps it's possible to
remove instead, can do that if preferred.  Depends on D6611609 to complete
build of tests cleanly.

Reviewed By: yfeldblum

Differential Revision: D6643759

fbshipit-source-id: f480d50383f85fbe905daaad74198b6557609347
parent 92d510df
/*
* Copyright 2017 Facebook, Inc.
* Copyright 2017-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -57,6 +57,12 @@
#define FOLLY_HAS_FEATURE(...) 0
#endif
#if defined(__has_include)
#define FOLLY_HAS_INCLUDE(...) __has_include(__VA_ARGS__)
#else
#define FOLLY_HAS_INCLUDE(...) 0
#endif
/* Define a convenience macro to test when address sanitizer is being used
* across the different compilers (e.g. clang, gcc) */
#if FOLLY_HAS_FEATURE(address_sanitizer) || __SANITIZE_ADDRESS__
......
......@@ -366,7 +366,9 @@ constexpr auto kMscVer = 0;
#define FOLLY_CPP14_CONSTEXPR inline
#endif
#if __cpp_coroutines >= 201703L || (_MSC_VER && _RESUMABLE_FUNCTIONS_SUPPORTED)
#if __cpp_coroutines >= 201703L && FOLLY_HAS_INCLUDE(<experimental/coroutine>)
#define FOLLY_HAS_COROUTINES 1
#elif _MSC_VER && _RESUMABLE_FUNCTIONS_SUPPORTED
#define FOLLY_HAS_COROUTINES 1
#endif
......
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