mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-24 23:11:14 +01:00
msvc: enable /Zc:preprocessor and make build compile cleanly
This commit is contained in:
parent
4db06bf85b
commit
969ea6e4f5
@ -32,39 +32,6 @@ bool MsgAlert(bool yes_no, MsgType style, const char* format, ...)
|
|||||||
void SetEnableAlert(bool enable);
|
void SetEnableAlert(bool enable);
|
||||||
} // namespace Common
|
} // namespace Common
|
||||||
|
|
||||||
#if defined(_WIN32) && (!defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL == 1)
|
|
||||||
#define SuccessAlert(format, ...) \
|
|
||||||
Common::MsgAlert(false, Common::MsgType::Information, format, __VA_ARGS__)
|
|
||||||
|
|
||||||
#define PanicAlert(format, ...) \
|
|
||||||
Common::MsgAlert(false, Common::MsgType::Warning, format, __VA_ARGS__)
|
|
||||||
|
|
||||||
#define PanicYesNo(format, ...) \
|
|
||||||
Common::MsgAlert(true, Common::MsgType::Warning, format, __VA_ARGS__)
|
|
||||||
|
|
||||||
#define AskYesNo(format, ...) Common::MsgAlert(true, Common::MsgType::Question, format, __VA_ARGS__)
|
|
||||||
|
|
||||||
#define CriticalAlert(format, ...) \
|
|
||||||
Common::MsgAlert(false, Common::MsgType::Critical, format, __VA_ARGS__)
|
|
||||||
|
|
||||||
// Use these macros (that do the same thing) if the message should be translated.
|
|
||||||
|
|
||||||
#define SuccessAlertT(format, ...) \
|
|
||||||
Common::MsgAlert(false, Common::MsgType::Information, format, __VA_ARGS__)
|
|
||||||
|
|
||||||
#define PanicAlertT(format, ...) \
|
|
||||||
Common::MsgAlert(false, Common::MsgType::Warning, format, __VA_ARGS__)
|
|
||||||
|
|
||||||
#define PanicYesNoT(format, ...) \
|
|
||||||
Common::MsgAlert(true, Common::MsgType::Warning, format, __VA_ARGS__)
|
|
||||||
|
|
||||||
#define AskYesNoT(format, ...) \
|
|
||||||
Common::MsgAlert(true, Common::MsgType::Question, format, __VA_ARGS__)
|
|
||||||
|
|
||||||
#define CriticalAlertT(format, ...) \
|
|
||||||
Common::MsgAlert(false, Common::MsgType::Critical, format, __VA_ARGS__)
|
|
||||||
|
|
||||||
#else
|
|
||||||
#define SuccessAlert(format, ...) \
|
#define SuccessAlert(format, ...) \
|
||||||
Common::MsgAlert(false, Common::MsgType::Information, format, ##__VA_ARGS__)
|
Common::MsgAlert(false, Common::MsgType::Information, format, ##__VA_ARGS__)
|
||||||
|
|
||||||
@ -95,4 +62,3 @@ void SetEnableAlert(bool enable);
|
|||||||
|
|
||||||
#define CriticalAlertT(format, ...) \
|
#define CriticalAlertT(format, ...) \
|
||||||
Common::MsgAlert(false, Common::MsgType::Critical, format, ##__VA_ARGS__)
|
Common::MsgAlert(false, Common::MsgType::Critical, format, ##__VA_ARGS__)
|
||||||
#endif
|
|
||||||
|
@ -15,12 +15,6 @@
|
|||||||
#include "Common/CommonTypes.h"
|
#include "Common/CommonTypes.h"
|
||||||
#include "Common/MsgHandler.h"
|
#include "Common/MsgHandler.h"
|
||||||
|
|
||||||
#define CHECK(cond, Message, ...) \
|
|
||||||
if (!(cond)) \
|
|
||||||
{ \
|
|
||||||
PanicAlert("%s failed in %s at line %d: " Message, __func__, __FILE__, __LINE__, __VA_ARGS__); \
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace DX11
|
namespace DX11
|
||||||
{
|
{
|
||||||
using Microsoft::WRL::ComPtr;
|
using Microsoft::WRL::ComPtr;
|
||||||
|
@ -9,13 +9,6 @@
|
|||||||
#include "Common/MsgHandler.h"
|
#include "Common/MsgHandler.h"
|
||||||
#include "VideoBackends/D3DCommon/Common.h"
|
#include "VideoBackends/D3DCommon/Common.h"
|
||||||
|
|
||||||
#define CHECK(cond, Message, ...) \
|
|
||||||
if (!(cond)) \
|
|
||||||
{ \
|
|
||||||
PanicAlert(__FUNCTION__ " failed in %s at line %d: " Message, __FILE__, __LINE__, \
|
|
||||||
__VA_ARGS__); \
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace DX12
|
namespace DX12
|
||||||
{
|
{
|
||||||
using Microsoft::WRL::ComPtr;
|
using Microsoft::WRL::ComPtr;
|
||||||
|
@ -12,6 +12,13 @@
|
|||||||
|
|
||||||
#include "Common/CommonTypes.h"
|
#include "Common/CommonTypes.h"
|
||||||
|
|
||||||
|
#define CHECK(cond, Message, ...) \
|
||||||
|
if (!(cond)) \
|
||||||
|
{ \
|
||||||
|
PanicAlert("%s failed in %s at line %d: " Message, __func__, __FILE__, __LINE__, \
|
||||||
|
##__VA_ARGS__); \
|
||||||
|
}
|
||||||
|
|
||||||
struct IDXGIFactory;
|
struct IDXGIFactory;
|
||||||
|
|
||||||
enum class AbstractTextureFormat : u32;
|
enum class AbstractTextureFormat : u32;
|
||||||
|
@ -20,11 +20,7 @@ constexpr u32 MAX_XFB_WIDTH = 720;
|
|||||||
// that are next to each other in memory (TODO: handle that situation).
|
// that are next to each other in memory (TODO: handle that situation).
|
||||||
constexpr u32 MAX_XFB_HEIGHT = 576;
|
constexpr u32 MAX_XFB_HEIGHT = 576;
|
||||||
|
|
||||||
#if defined(_WIN32) && (!defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL == 1)
|
|
||||||
#define PRIM_LOG(...) DEBUG_LOG(VIDEO, __VA_ARGS__)
|
|
||||||
#else
|
|
||||||
#define PRIM_LOG(...) DEBUG_LOG(VIDEO, ##__VA_ARGS__)
|
#define PRIM_LOG(...) DEBUG_LOG(VIDEO, ##__VA_ARGS__)
|
||||||
#endif
|
|
||||||
|
|
||||||
// warning: mapping buffer should be disabled to use this
|
// warning: mapping buffer should be disabled to use this
|
||||||
// #define LOG_VTX() DEBUG_LOG(VIDEO, "vtx: %f %f %f, ", ((float*)g_vertex_manager_write_ptr)[-3],
|
// #define LOG_VTX() DEBUG_LOG(VIDEO, "vtx: %f %f %f, ", ((float*)g_vertex_manager_write_ptr)[-3],
|
||||||
|
@ -81,12 +81,8 @@
|
|||||||
<LanguageStandard>stdcpplatest</LanguageStandard>
|
<LanguageStandard>stdcpplatest</LanguageStandard>
|
||||||
<!--Enable Standard Conformance-->
|
<!--Enable Standard Conformance-->
|
||||||
<ConformanceMode>true</ConformanceMode>
|
<ConformanceMode>true</ConformanceMode>
|
||||||
<!--Enforce some behaviors as standards-conformant when they don't default as such.
|
<!--Enforce some behaviors as standards-conformant when they don't default as such.-->
|
||||||
TODO: Enable /Zc:preprocessor. Note as of VS 16.7 and despite claims on msdn, the
|
<AdditionalOptions>/Zc:externConstexpr,lambda,preprocessor,throwingNew /volatile:iso %(AdditionalOptions)</AdditionalOptions>
|
||||||
new preprocessor has some notable bugs/regressions, and isn't warning-free when
|
|
||||||
used on WinSDK (<= 10.0.19041) headers.
|
|
||||||
-->
|
|
||||||
<AdditionalOptions>/Zc:externConstexpr,lambda,throwingNew /volatile:iso %(AdditionalOptions)</AdditionalOptions>
|
|
||||||
<!--Enable detailed debug info-->
|
<!--Enable detailed debug info-->
|
||||||
<AdditionalOptions>/Zo %(AdditionalOptions)</AdditionalOptions>
|
<AdditionalOptions>/Zo %(AdditionalOptions)</AdditionalOptions>
|
||||||
<!--Treat sources as utf-8-->
|
<!--Treat sources as utf-8-->
|
||||||
@ -109,6 +105,10 @@
|
|||||||
Currently jits use some annoying code patterns which makes this common
|
Currently jits use some annoying code patterns which makes this common
|
||||||
-->
|
-->
|
||||||
<DisableSpecificWarnings>4245;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
<DisableSpecificWarnings>4245;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
|
<!-- Temporarily disable warnings to enable /Zc:preprocessor compatibility with WinSDK headers.
|
||||||
|
5105 macro expansion producing 'defined' has undefined behavior
|
||||||
|
-->
|
||||||
|
<DisableSpecificWarnings>5105;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
<!-- Enable some off-by-default warnings
|
<!-- Enable some off-by-default warnings
|
||||||
4263 Non-virtual member function hides base class virtual function
|
4263 Non-virtual member function hides base class virtual function
|
||||||
4265 Class has virtual functions, but destructor is not virtual
|
4265 Class has virtual functions, but destructor is not virtual
|
||||||
|
Loading…
x
Reference in New Issue
Block a user