Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix linux and macOS build #2073

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions folly/concurrency/test/ConcurrentHashMapTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
#include <folly/concurrency/ConcurrentHashMap.h>

#include <atomic>
#if __cplusplus > 201703L
// std::latch becomes visible in C++20 mode
#include <latch>
#endif
#include <limits>
#include <memory>
#include <thread>
Expand Down Expand Up @@ -1135,6 +1138,8 @@ TYPED_TEST_P(ConcurrentHashMapTest, ConcurrentInsertClear) {
}

TYPED_TEST_P(ConcurrentHashMapTest, StressTestReclamation) {
// std::latch becomes visible in C++20 mode
#if __cplusplus > 201703L
// Create a map where we keep reclaiming a lot of objects that are linked to
// one node.

Expand Down Expand Up @@ -1178,6 +1183,7 @@ TYPED_TEST_P(ConcurrentHashMapTest, StressTestReclamation) {
for (auto& t : threads) {
join;
}
#endif
}

REGISTER_TYPED_TEST_SUITE_P(
Expand Down
6 changes: 3 additions & 3 deletions folly/detail/FileUtilDetail.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ std::string getTemporaryFilePathStringWithoutTempDirectory(

std::string getTemporaryFilePathStringWithTemporaryDirectory(
const std::string& temporaryDirectory) {
#if defined(__linux__) && !FOLLY_MOBILE
#if !defined(_WIN32) && !FOLLY_MOBILE
return (temporaryDirectory.back() == '/')
? (temporaryDirectory + std::string{"tempForAtomicWrite.XXXXXX"})
: (temporaryDirectory + std::string{"/tempForAtomicWrite.XXXXXX"});
#else
// The implementation currently, does not support any platform other than
// linux for temporary directory based atomic file writes.
// The implementation currently does not support win32 or mobile
// for temporary directory based atomic file writes.
static_cast<void>(temporaryDirectory);
assert(false);

Expand Down
2 changes: 1 addition & 1 deletion folly/lang/test/ExceptionTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ template <typename Ex>
static std::string message_for_terminate_with(std::string const& what) {
auto const name = folly::pretty_name<Ex>();
std::string const p0 = "terminate called after throwing an instance of";
std::string const p1 = "terminating with uncaught exception of type";
std::string const p1 = "terminating (due to|with) uncaught exception of type";
// clang-format off
return
folly::kIsGlibcxx ? p0 + " '" + name + "'\\s+what\\(\\):\\s+" + what :
Expand Down
3 changes: 3 additions & 0 deletions folly/logging/test/RateLimiterTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,10 @@ TEST(RateLimiter, concurrentThreads) {
EXPECT_EQ(maxEvents, count.load(std::memory_order_relaxed));
}

#if __cplusplus > 201703L
// std::chrono::years becomes visible in C++20 mode
TEST(RateLimiter, LargeInterval) {
IntervalRateLimiter limiter{1, std::chrono::hours{8765}}; // Just under a year
EXPECT_TRUE(limiter.check());
}
#endif
1 change: 1 addition & 0 deletions folly/stats/DigestBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#pragma once

#include <memory>
#include <vector>

#include <folly/Memory.h>
#include <folly/SpinLock.h>
Expand Down
1 change: 1 addition & 0 deletions folly/test/ConstexprMathTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#include <folly/ConstexprMath.h>

#include <array>
#include <cmath>
#include <limits>
#include <type_traits>
Expand Down
Loading