From 74435b1aa06cdd6326fc4f8a8e23b402258e2831 Mon Sep 17 00:00:00 2001 From: Maniform Date: Fri, 4 Jun 2021 16:06:53 +0200 Subject: [PATCH] Fixed include problems and compilation errors - Replaced bad include definitions - Define Format function as a Windows only - Removed AssertMsg and include assert which causes problems --- src/openvr_api_public.cpp | 12 ++++++------ src/vrcommon/dirtools_public.cpp | 6 +++--- src/vrcommon/envvartools_public.cpp | 4 ++-- src/vrcommon/pathtools_public.cpp | 4 ++-- src/vrcommon/sharedlibtools_public.cpp | 2 +- src/vrcommon/strtools_public.cpp | 11 ++++++----- src/vrcommon/vrpathregistry_public.cpp | 10 +++++----- 7 files changed, 25 insertions(+), 24 deletions(-) diff --git a/src/openvr_api_public.cpp b/src/openvr_api_public.cpp index 98ba7625..bdb668b5 100644 --- a/src/openvr_api_public.cpp +++ b/src/openvr_api_public.cpp @@ -2,12 +2,12 @@ #define VR_API_EXPORT 1 #include "openvr.h" #include "ivrclientcore.h" -#include -#include -#include -#include "hmderrors_public.h" -#include -#include +#include +#include +#include +#include +#include +#include #include using vr::EVRInitError; diff --git a/src/vrcommon/dirtools_public.cpp b/src/vrcommon/dirtools_public.cpp index e5fccc1d..a9ab8a4f 100644 --- a/src/vrcommon/dirtools_public.cpp +++ b/src/vrcommon/dirtools_public.cpp @@ -1,7 +1,7 @@ //========= Copyright Valve Corporation ============// -#include -#include -#include +#include +#include +#include #include #include diff --git a/src/vrcommon/envvartools_public.cpp b/src/vrcommon/envvartools_public.cpp index b6de2a80..b8522e7a 100644 --- a/src/vrcommon/envvartools_public.cpp +++ b/src/vrcommon/envvartools_public.cpp @@ -1,6 +1,6 @@ //========= Copyright Valve Corporation ============// -#include -#include +#include +#include #include #include #include diff --git a/src/vrcommon/pathtools_public.cpp b/src/vrcommon/pathtools_public.cpp index 2503ec64..1d1cb548 100644 --- a/src/vrcommon/pathtools_public.cpp +++ b/src/vrcommon/pathtools_public.cpp @@ -1,6 +1,6 @@ //========= Copyright Valve Corporation ============// -#include -#include +#include +#include #if defined( _WIN32) #include diff --git a/src/vrcommon/sharedlibtools_public.cpp b/src/vrcommon/sharedlibtools_public.cpp index cce1528d..35bbe86e 100644 --- a/src/vrcommon/sharedlibtools_public.cpp +++ b/src/vrcommon/sharedlibtools_public.cpp @@ -1,5 +1,5 @@ //========= Copyright Valve Corporation ============// -#include +#include #include #if defined(_WIN32) diff --git a/src/vrcommon/strtools_public.cpp b/src/vrcommon/strtools_public.cpp index 343ec42a..7d21bfde 100644 --- a/src/vrcommon/strtools_public.cpp +++ b/src/vrcommon/strtools_public.cpp @@ -1,5 +1,5 @@ //========= Copyright Valve Corporation ============// -#include +#include #include #include #include @@ -9,7 +9,7 @@ #include #include #include -#include +//#include #if defined( _WIN32 ) #include @@ -111,6 +111,7 @@ std::wstring UTF8to16(const char * in) std::wstring UTF8to16( const std::string & in ) { return UTF8to16( in.c_str() ); } +#if defined( _WIN32 ) //----------------------------------------------------------------------------- // Purpose: Format string to std::string converter //----------------------------------------------------------------------------- @@ -128,7 +129,7 @@ std::string Format( const char *pchFormat, ... ) // Something went fairly wrong if ( unSize < 0 ) { - AssertMsg( false, "Format string parse failure" ); + //AssertMsg( false, "Format string parse failure" ); return ""; } @@ -149,13 +150,13 @@ std::string Format( const char *pchFormat, ... ) // Double check, just in case if ( unSize < 0 ) { - AssertMsg( false, "Format string parse failure" ); + //AssertMsg( false, "Format string parse failure" ); return ""; } return vecChar.data(); } - +#endif diff --git a/src/vrcommon/vrpathregistry_public.cpp b/src/vrcommon/vrpathregistry_public.cpp index 2746bdba..3c991b46 100644 --- a/src/vrcommon/vrpathregistry_public.cpp +++ b/src/vrcommon/vrpathregistry_public.cpp @@ -1,11 +1,11 @@ //========= Copyright Valve Corporation ============// -#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include #if defined( WIN32 ) #include