Commit bddd247e authored by Andrew Gallagher's avatar Andrew Gallagher Committed by Facebook GitHub Bot

Fix `F14*Fallback.h` headers in modular builds

Summary:
The `F14*Fallback.h` headers are meant to be included textually
from `F14*.h` headers and currently fail to compile in modular
builds, as a) they have references to items defined in their intended
enclosing header and b) even if successfully compiled alone would
provide conflicting definitions of the `F14*` structures.

This diff adds the `FOLLY_F14_VECTOR_INTRINSICS_AVAILABLE`
gate in the `F14*Fallback.h` headers so that they won't get compiled
when they're not used.

Reviewed By: yfeldblum, luciang

Differential Revision: D22568097

fbshipit-source-id: a75b3a4a687e3034dd9c4c3f7fd0a41bfd465272
parent 98eb49fa
...@@ -1298,13 +1298,11 @@ class F14FastMap : public std::conditional_t< ...@@ -1298,13 +1298,11 @@ class F14FastMap : public std::conditional_t<
}; };
} // namespace folly } // namespace folly
#else // !if FOLLY_F14_VECTOR_INTRINSICS_AVAILABLE #endif // if FOLLY_F14_VECTOR_INTRINSICS_AVAILABLE
//////// Compatibility for unsupported platforms (not x86_64 and not aarch64) //////// Compatibility for unsupported platforms (not x86_64 and not aarch64)
#include <folly/container/detail/F14MapFallback.h> #include <folly/container/detail/F14MapFallback.h>
#endif // if FOLLY_F14_VECTOR_INTRINSICS_AVAILABLE else
namespace folly { namespace folly {
namespace f14 { namespace f14 {
namespace detail { namespace detail {
......
...@@ -1022,13 +1022,11 @@ class F14FastSet ...@@ -1022,13 +1022,11 @@ class F14FastSet
}; };
} // namespace folly } // namespace folly
#else // !if FOLLY_F14_VECTOR_INTRINSICS_AVAILABLE #endif // if FOLLY_F14_VECTOR_INTRINSICS_AVAILABLE
//////// Compatibility for unsupported platforms (not x86_64 and not aarch64) //////// Compatibility for unsupported platforms (not x86_64 and not aarch64)
#include <folly/container/detail/F14SetFallback.h> #include <folly/container/detail/F14SetFallback.h>
#endif // if FOLLY_F14_VECTOR_INTRINSICS_AVAILABLE else
namespace folly { namespace folly {
namespace f14 { namespace f14 {
namespace detail { namespace detail {
......
...@@ -16,12 +16,16 @@ ...@@ -16,12 +16,16 @@
#pragma once #pragma once
#include <folly/container/detail/F14IntrinsicsAvailability.h>
/** /**
* This file is intended to be included only by F14Map.h. It contains fallback * This file is intended to be included only by F14Map.h. It contains fallback
* implementations of F14Map types for platforms that do not support the * implementations of F14Map types for platforms that do not support the
* required SIMD instructions, based on std::unordered_map. * required SIMD instructions, based on std::unordered_map.
*/ */
#if !FOLLY_F14_VECTOR_INTRINSICS_AVAILABLE
#include <unordered_map> #include <unordered_map>
#include <algorithm> #include <algorithm>
...@@ -638,3 +642,5 @@ class F14FastMap ...@@ -638,3 +642,5 @@ class F14FastMap
}; };
} // namespace folly } // namespace folly
#endif // !if FOLLY_F14_VECTOR_INTRINSICS_AVAILABLE
...@@ -16,12 +16,16 @@ ...@@ -16,12 +16,16 @@
#pragma once #pragma once
#include <folly/container/detail/F14IntrinsicsAvailability.h>
/** /**
* This file is intended to be included only by F14Set.h. It contains fallback * This file is intended to be included only by F14Set.h. It contains fallback
* implementations of F14Set types for platforms that do not support the * implementations of F14Set types for platforms that do not support the
* required SIMD instructions, based on std::unordered_set. * required SIMD instructions, based on std::unordered_set.
*/ */
#if !FOLLY_F14_VECTOR_INTRINSICS_AVAILABLE
#include <algorithm> #include <algorithm>
#include <unordered_set> #include <unordered_set>
...@@ -431,3 +435,5 @@ class F14FastSet ...@@ -431,3 +435,5 @@ class F14FastSet
}; };
} // namespace folly } // namespace folly
#endif // !if FOLLY_F14_VECTOR_INTRINSICS_AVAILABLE
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