detail/SocketFastOpen.cpp \
MacAddress.cpp \
memory/ThreadCachedArena.cpp \
- Poly.cpp \
portability/Dirent.cpp \
portability/Fcntl.cpp \
portability/Libgen.cpp \
experimental/symbolizer/Symbolizer.cpp
endif
+if HAVE_VARIABLE_TEMPLATES
+libfolly_la_SOURCES += \
+ Poly.cpp
+endif
+
libfollybasesse42_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(LT_VERSION)
libfollybasesse42_la_CXXFLAGS = -msse4.2 -mpclmul
* limitations under the License.
*/
+#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 5
+#pragma message "Folly.Poly requires gcc-5 or greater"
+#else
+
#include <folly/Poly.h>
namespace folly {
[[noreturn]] void throwBadPolyCast() { throw BadPolyCast(); }
} // namespace detail
} // namespace folly
+
+#endif
#pragma once
+#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 5
+#error Folly.Poly requires gcc-5 or greater
+#endif
+
#include <cassert>
#include <new>
#include <type_traits>
[Define to 1 if the compiler has VLA (variable-length array) support,
otherwise define to 0])
+AC_CACHE_CHECK(
+ [for variable template support],
+ [folly_cv_prog_cc_have_variable_templates],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE[
+ template <class> constexpr bool g = true;
+ int main() {}
+ ]],
+ [folly_cv_prog_cc_have_variable_templates=yes],
+ [folly_cv_prog_cc_have_variable_templates=no])])
+
+AM_CONDITIONAL(
+ [HAVE_VARIABLE_TEMPLATES],
+ [test "x${folly_cv_prog_cc_have_variable_templates}" = "xyes"],
+ [Define to 1 if the compiler supports variable templates])
+
# Checks for library functions.
AC_CHECK_FUNCS([malloc_size \
malloc_usable_size \
fingerprint_test_LDADD = libfollytestmain.la $(top_builddir)/libfollybenchmark.la
TESTS += fingerprint_test
+if HAVE_VARIABLE_TEMPLATES
poly_test_SOURCES = PolyTest.cpp
poly_test_LDADD = libfollytestmain.la
TESTS += poly_test
+endif
portability_test_SOURCES = PortabilityTest.cpp
portability_test_LDADD = libfollytestmain.la
* limitations under the License.
*/
+#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 5
+#pragma message "Folly.Poly requires gcc-5 or greater"
+#else
#include <folly/Poly.h>
#include <folly/Conv.h>
cc = aref + bref;
EXPECT_EQ(6, poly_cast<int>(cc));
}
+#endif