fix flaky ConnectTFOTimeout and ConnectTFOFallbackTimeout tests
[folly.git] / folly / Portability.h
index c9616ea7caa23dcaa304007be149877249218b88..2d3ec417c3f32210679d692e3c7e7d35871b93a2 100644 (file)
@@ -92,6 +92,13 @@ constexpr bool kHasUnalignedAccess = false;
 # define FOLLY_ALWAYS_INLINE inline
 #endif
 
+// target
+#ifdef _MSC_VER
+# define FOLLY_TARGET_ATTRIBUTE(target)
+#else
+# define FOLLY_TARGET_ATTRIBUTE(target) __attribute__((__target__(target)))
+#endif
+
 // detection for 64 bit
 #if defined(__x86_64__) || defined(_M_X64)
 # define FOLLY_X64 1
@@ -200,16 +207,6 @@ namespace std { typedef ::max_align_t max_align_t; }
 #undef FOLLY_TLS
 #endif
 
-// Define to 1 if you have the `preadv' and `pwritev' functions, respectively
-#if !defined(FOLLY_HAVE_PREADV) && !defined(FOLLY_HAVE_PWRITEV)
-# if defined(__GLIBC_PREREQ)
-#  if __GLIBC_PREREQ(2, 10)
-#   define FOLLY_HAVE_PREADV 1
-#   define FOLLY_HAVE_PWRITEV 1
-#  endif
-# endif
-#endif
-
 // It turns out that GNU libstdc++ and LLVM libc++ differ on how they implement
 // the 'std' namespace; the latter uses inline namespaces. Wrap this decision
 // up in a macro to make forward-declarations easier.
@@ -266,13 +263,6 @@ namespace std { typedef ::max_align_t max_align_t; }
 #ifdef _MSC_VER
 #include <folly/portability/SysTypes.h>
 
-// sprintf semantics are not exactly identical
-// but current usage is not a problem
-# define snprintf _snprintf
-
-// semantics here are identical
-# define strerror_r(errno,buf,len) strerror_s(buf,len,errno)
-
 // compiler specific to compiler specific
 // nolint
 # define __PRETTY_FUNCTION__ __FUNCSIG__