Remove MSVC-specific code Bug: 389951208 Change-Id: Idd870fa9621c4164764b10e0cd7ca678fc8bc4a7 Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/127990 Reviewed-by: Thomas Sepez <tsepez@google.com> Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Nico Weber <thakis@chromium.org> Reviewed-by: Nico Weber <thakis@google.com> Reviewed-by: Tom Sepez <tsepez@chromium.org>
diff --git a/core/fxcrt/compiler_specific.h b/core/fxcrt/compiler_specific.h index 5e2b033..9f8bd97 100644 --- a/core/fxcrt/compiler_specific.h +++ b/core/fxcrt/compiler_specific.h
@@ -21,8 +21,6 @@ #define NOINLINE [[clang::noinline]] #elif defined(COMPILER_GCC) && HAS_ATTRIBUTE(noinline) #define NOINLINE __attribute__((noinline)) -#elif defined(COMPILER_MSVC) -#define NOINLINE __declspec(noinline) #else #define NOINLINE #endif
diff --git a/core/fxcrt/debug/alias.cc b/core/fxcrt/debug/alias.cc index 213b6f9..2d51ab2 100644 --- a/core/fxcrt/debug/alias.cc +++ b/core/fxcrt/debug/alias.cc
@@ -8,18 +8,14 @@ namespace pdfium { -#if defined(COMPILER_MSVC) -#pragma optimize("", off) -#elif defined(__clang__) +#if defined(__clang__) #pragma clang optimize off #endif void Alias(const void* var) { } -#if defined(COMPILER_MSVC) -#pragma optimize("", on) -#elif defined(__clang__) +#if defined(__clang__) #pragma clang optimize on #endif
diff --git a/core/fxcrt/fx_memory_wrappers.h b/core/fxcrt/fx_memory_wrappers.h index f4f0b06..caabe2a 100644 --- a/core/fxcrt/fx_memory_wrappers.h +++ b/core/fxcrt/fx_memory_wrappers.h
@@ -33,11 +33,9 @@ template <class T, void* Alloc(size_t, size_t), void Free(void*)> struct FxPartitionAllocAllocator { public: -#if !defined(COMPILER_MSVC) || defined(NDEBUG) static_assert(std::is_arithmetic<T>::value || std::is_enum<T>::value || IsFXDataPartitionException<T>::value, "Only numeric types allowed in this partition"); -#endif using value_type = T; using pointer = T*;
diff --git a/core/fxcrt/immediate_crash.h b/core/fxcrt/immediate_crash.h index cb980d6..490a71c 100644 --- a/core/fxcrt/immediate_crash.h +++ b/core/fxcrt/immediate_crash.h
@@ -91,13 +91,7 @@ #elif defined(COMPILER_MSVC) -#if !defined(__clang__) - -// MSVC x64 doesn't support inline asm, so use the MSVC intrinsic. -#define TRAP_SEQUENCE1_() __debugbreak() -#define TRAP_SEQUENCE2_() - -#elif defined(ARCH_CPU_ARM64) +#if defined(ARCH_CPU_ARM64) // Windows ARM64 uses "BRK #F000" as its breakpoint instruction, and // __debugbreak() generates that in both VC++ and clang. @@ -112,7 +106,7 @@ #define TRAP_SEQUENCE1_() asm volatile("int3") #define TRAP_SEQUENCE2_() asm volatile("ud2") -#endif // __clang__ +#endif // defined(ARCH_CPU_ARM64) #else
diff --git a/pdfium.gni b/pdfium.gni index 7cdb44b..544bfb2 100644 --- a/pdfium.gni +++ b/pdfium.gni
@@ -79,9 +79,6 @@ # Don't build against bundled zlib. use_system_zlib = false - - # Enable SSE2 for MSVC builds. Ignored if it's not a MSVC build. - msvc_use_sse2 = true } assert(!pdf_is_complete_lib || !is_component_build,
diff --git a/skia/BUILD.gn b/skia/BUILD.gn index 234ebd7..222f1a3 100644 --- a/skia/BUILD.gn +++ b/skia/BUILD.gn
@@ -187,20 +187,6 @@ # fairly small size. http://crbug.com/314387 "SK_DEFAULT_FONT_CACHE_COUNT_LIMIT=256", ] - - cflags = [ - "/wd4244", # conversion from 'type1( __int64)' to 'type2 (unsigned int)' - "/wd4341", # signed value is out of range for enum constant. - "/wd4345", # Object is default-initialized if initialization is omitted. - "/wd4390", # ';'empty statement found in looping;is it what was intended? - "/wd4554", # 'operator' : check operator precedence for possible error - "/wd4748", # compiler will disable optimizations if a function has inline - # assembly code contains flow control(jmp or jcc) statements. - - "/wd4800", # forcing value to bool 'true/false'(assigning int to bool). - "/wd5041", # out-of-line definition for constexpr static data member is - # not needed and is deprecated in C++17 - ] } } @@ -428,13 +414,6 @@ "//build/config/compiler:no_chromium_code", ] public_configs = [ ":skia_config" ] - - if (is_win) { - cflags_cc = [ - "/wd5041", # out-of-line definition for constexpr static data member is - # not needed and is deprecated in C++17 - ] - } } }
diff --git a/third_party/googletest/BUILD.gn b/third_party/googletest/BUILD.gn index 2c46922..d2964aa 100644 --- a/third_party/googletest/BUILD.gn +++ b/third_party/googletest/BUILD.gn
@@ -31,10 +31,6 @@ "custom", "src/googletest/include", ] - - if (is_win) { - cflags = [ "/wd4800" ] # Unused variable warning. - } } config("gmock_config") {