Commit 96c62e34 authored by James Donald's avatar James Donald Committed by Facebook Github Bot

Make defined(_MSC_VER) checks consistent for -Wundef

Summary: Note: also making the `__GNUC__ || __clang__` nearby part in Pretty.h the same so that the header doesn't appear inconsistent, likewise for Hardware.h

Reviewed By: yfeldblum

Differential Revision: D19237732

fbshipit-source-id: bf3270ddf2102ea722be1eb1a557234d264f9af7
parent f9956e1c
......@@ -183,7 +183,7 @@
#endif
// attribute hidden
#if _MSC_VER
#if defined(_MSC_VER)
#define FOLLY_ATTR_VISIBILITY_HIDDEN
#elif defined(__GNUC__)
#define FOLLY_ATTR_VISIBILITY_HIDDEN __attribute__((__visibility__("hidden")))
......
......@@ -306,7 +306,7 @@ template <
!std::is_reference<To>::value || std::is_reference<From>::value>::type>
using SafeResultOf = decltype(static_cast<To>(std::declval<From>()));
#if _MSC_VER
#if defined(_MSC_VER)
// Need a workaround for MSVC to avoid the inscrutable error:
//
// folly\function.h(...) : fatal error C1001: An internal error has
......
......@@ -21,7 +21,7 @@
#include <chrono>
#include <cstdint>
#if _MSC_VER
#if defined(_MSC_VER)
extern "C" std::uint64_t __rdtsc();
#pragma intrinsic(__rdtsc)
#endif
......@@ -29,9 +29,9 @@ extern "C" std::uint64_t __rdtsc();
namespace folly {
inline std::uint64_t hardware_timestamp() {
#if _MSC_VER
#if defined(_MSC_VER)
return __rdtsc();
#elif __GNUC__ && (__i386__ || FOLLY_X64)
#elif defined(__GNUC__) && (defined(__i386__) || FOLLY_X64)
return __builtin_ia32_rdtsc();
#else
// use steady_clock::now() as an approximation for the timestamp counter on
......
......@@ -83,14 +83,14 @@ using pretty_default_tag = std::conditional_t< //
template <typename T>
static constexpr auto pretty_raw(pretty_tag_msc) {
#if _MSC_VER
#if defined(_MSC_VER)
return pretty_carray_from(__FUNCSIG__);
#endif
}
template <typename T>
static constexpr auto pretty_raw(pretty_tag_gcc) {
#if __GNUC__ || __clang__
#if defined(__GNUC__) || defined(__clang__)
return pretty_carray_from(__PRETTY_FUNCTION__);
#endif
}
......
......@@ -126,7 +126,7 @@ constexpr auto is_atomic<std::atomic<Integer>> = true;
#if FOLLY_X64
#if _MSC_VER
#if defined(_MSC_VER)
template <typename Integer>
inline bool atomic_fetch_set_x86(
......
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