From ff3d799871aa24702812449c2e53533cfdef5ccd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 31 Aug 2017 16:43:29 +0200 Subject: [PATCH] Remove snprintf compatibility hacks for MSVC versions before 2015 --- Common/CommonFuncs.h | 4 ---- Core/HLE/sceKernelMemory.cpp | 2 -- UI/DevScreens.cpp | 1 - UWP/NativeUWP/NativeUWP.vcxproj | 4 +--- UWP/NativeUWP/NativeUWP.vcxproj.filters | 8 +------ Windows/Debugger/BreakpointWindow.cpp | 4 +--- ext/native/Android.mk | 1 - ext/native/base/compat.cpp | 28 ------------------------- ext/native/base/compat.h | 11 ---------- ext/native/base/logging.h | 1 - ext/native/math/lin/matrix4x4.cpp | 3 +-- ext/native/native.vcxproj | 4 +--- ext/native/native.vcxproj.filters | 8 +------ 13 files changed, 6 insertions(+), 73 deletions(-) delete mode 100644 ext/native/base/compat.cpp delete mode 100644 ext/native/base/compat.h diff --git a/Common/CommonFuncs.h b/Common/CommonFuncs.h index c8905fb6ce..7b69903df8 100644 --- a/Common/CommonFuncs.h +++ b/Common/CommonFuncs.h @@ -17,12 +17,8 @@ #pragma once -#include "base/compat.h" #include "CommonTypes.h" -template struct CompileTimeAssert; -template<> struct CompileTimeAssert {}; - #ifndef ARRAY_SIZE #define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) #endif diff --git a/Core/HLE/sceKernelMemory.cpp b/Core/HLE/sceKernelMemory.cpp index 6c5a0f67b1..ab71ca4d67 100644 --- a/Core/HLE/sceKernelMemory.cpp +++ b/Core/HLE/sceKernelMemory.cpp @@ -20,8 +20,6 @@ #include #include -#include "base/compat.h" - #include "Common/ChunkFile.h" #include "Core/HLE/HLE.h" #include "Core/HLE/FunctionWrappers.h" diff --git a/UI/DevScreens.cpp b/UI/DevScreens.cpp index 3ee7ae86fe..12038d3dd5 100644 --- a/UI/DevScreens.cpp +++ b/UI/DevScreens.cpp @@ -17,7 +17,6 @@ #include -#include "base/compat.h" #include "gfx_es2/gpu_features.h" #include "i18n/i18n.h" #include "ui/ui_context.h" diff --git a/UWP/NativeUWP/NativeUWP.vcxproj b/UWP/NativeUWP/NativeUWP.vcxproj index c03420e802..9c2153302f 100644 --- a/UWP/NativeUWP/NativeUWP.vcxproj +++ b/UWP/NativeUWP/NativeUWP.vcxproj @@ -304,7 +304,6 @@ - @@ -394,7 +393,6 @@ - @@ -1317,4 +1315,4 @@ - \ No newline at end of file + diff --git a/UWP/NativeUWP/NativeUWP.vcxproj.filters b/UWP/NativeUWP/NativeUWP.vcxproj.filters index 04fe80993b..b009776eec 100644 --- a/UWP/NativeUWP/NativeUWP.vcxproj.filters +++ b/UWP/NativeUWP/NativeUWP.vcxproj.filters @@ -70,9 +70,6 @@ base - - base - base @@ -476,9 +473,6 @@ base - - base - base @@ -726,4 +720,4 @@ gfx - \ No newline at end of file + diff --git a/Windows/Debugger/BreakpointWindow.cpp b/Windows/Debugger/BreakpointWindow.cpp index 7c17fb64d5..b00da57324 100644 --- a/Windows/Debugger/BreakpointWindow.cpp +++ b/Windows/Debugger/BreakpointWindow.cpp @@ -1,12 +1,10 @@ -#include +#include -#include "base/compat.h" #include "util/text/utf8.h" #include "BreakpointWindow.h" #include "../resource.h" - BreakpointWindow* BreakpointWindow::bp; INT_PTR CALLBACK BreakpointWindow::dlgFunc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam) diff --git a/ext/native/Android.mk b/ext/native/Android.mk index 4ff5c8005d..14310e2276 100644 --- a/ext/native/Android.mk +++ b/ext/native/Android.mk @@ -9,7 +9,6 @@ LOCAL_ARM_MODE := arm LOCAL_SRC_FILES :=\ base/backtrace.cpp \ base/buffer.cpp \ - base/compat.cpp \ base/display.cpp \ base/timeutil.cpp \ base/colorutil.cpp \ diff --git a/ext/native/base/compat.cpp b/ext/native/base/compat.cpp deleted file mode 100644 index cef9d6c008..0000000000 --- a/ext/native/base/compat.cpp +++ /dev/null @@ -1,28 +0,0 @@ -#include -#include - -#include "base/compat.h" - -#if defined(_MSC_VER) && _MSC_VER < 1900 - -static int c99_vsnprintf(char* str, size_t size, const char* format, va_list ap) { - int count = -1; - if (size != 0) - count = _vsnprintf_s(str, size, _TRUNCATE, format, ap); - if (count == -1) - count = _vscprintf(format, ap); - return count; -} - -int c99_snprintf(char* str, size_t size, const char* format, ...) { - int count; - va_list ap; - - va_start(ap, format); - count = c99_vsnprintf(str, size, format, ap); - va_end(ap); - - return count; -} - -#endif \ No newline at end of file diff --git a/ext/native/base/compat.h b/ext/native/base/compat.h deleted file mode 100644 index e8e9621cf9..0000000000 --- a/ext/native/base/compat.h +++ /dev/null @@ -1,11 +0,0 @@ -#pragma once - -// Implement C99 functions and similar that are missing in MSVC. - -#if defined(_MSC_VER) && _MSC_VER < 1900 - -int c99_snprintf(char* str, size_t size, const char* format, ...); -#define snprintf c99_snprintf -#define vscprintf _vscprintf - -#endif \ No newline at end of file diff --git a/ext/native/base/logging.h b/ext/native/base/logging.h index 2054ae5d98..6650d865b9 100644 --- a/ext/native/base/logging.h +++ b/ext/native/base/logging.h @@ -4,7 +4,6 @@ #include "base/arch.h" #include "base/backtrace.h" -#include "base/compat.h" // Simple wrapper around Android's logging interface that also allows other // implementations, and also some misc utilities. diff --git a/ext/native/math/lin/matrix4x4.cpp b/ext/native/math/lin/matrix4x4.cpp index 703ed366c3..33d2714c6e 100644 --- a/ext/native/math/lin/matrix4x4.cpp +++ b/ext/native/math/lin/matrix4x4.cpp @@ -1,8 +1,7 @@ #include "math/lin/matrix4x4.h" -#include +#include -#include "base/compat.h" #include "math/lin/vec3.h" #include "math/lin/quat.h" #include "math/fast/fast_matrix.h" diff --git a/ext/native/native.vcxproj b/ext/native/native.vcxproj index cbee2ad055..ea47f94dea 100644 --- a/ext/native/native.vcxproj +++ b/ext/native/native.vcxproj @@ -196,7 +196,6 @@ - @@ -295,7 +294,6 @@ - @@ -758,4 +756,4 @@ - \ No newline at end of file + diff --git a/ext/native/native.vcxproj.filters b/ext/native/native.vcxproj.filters index 417a918213..e551ed8b0e 100644 --- a/ext/native/native.vcxproj.filters +++ b/ext/native/native.vcxproj.filters @@ -281,9 +281,6 @@ thread - - base - gfx @@ -736,9 +733,6 @@ thread - - base - base @@ -859,4 +853,4 @@ {06c6305a-a646-485b-85b9-645a24dd6553} - \ No newline at end of file +