mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-08-14 20:52:26 +00:00
fix: clean up __valid macro leak at source in sal.h instead of patching every include site
This commit is contained in:
parent
70194c6a3b
commit
4271e562a6
|
|
@ -4234,6 +4234,11 @@ __PRIMOP(int, _In_function_class_(__In_impl_ char *);)
|
||||||
#define _Maybe_raises_SEH_exception_ _Pre_ _SA_annotes1(SAL_inTry, __yes)
|
#define _Maybe_raises_SEH_exception_ _Pre_ _SA_annotes1(SAL_inTry, __yes)
|
||||||
#define _Raises_SEH_exception_ _Group_(_Maybe_raises_SEH_exception_ _Analysis_noreturn_)
|
#define _Raises_SEH_exception_ _Group_(_Maybe_raises_SEH_exception_ _Analysis_noreturn_)
|
||||||
|
|
||||||
|
// Clean up macros that collide with libstdc++ internals
|
||||||
|
#undef __valid
|
||||||
|
#undef __notvalid
|
||||||
|
#undef __maybevalid
|
||||||
|
|
||||||
#ifdef __cplusplus // [
|
#ifdef __cplusplus // [
|
||||||
}
|
}
|
||||||
#endif // ]
|
#endif // ]
|
||||||
|
|
@ -6,19 +6,6 @@
|
||||||
#include "winapi_stubs.h"
|
#include "winapi_stubs.h"
|
||||||
#include "Minecraft.Client/Linux/Stubs/DirectXMath/DirectXMath.h"
|
#include "Minecraft.Client/Linux/Stubs/DirectXMath/DirectXMath.h"
|
||||||
|
|
||||||
// The DirectXMath SAL shim defines a few reserved identifiers such as
|
|
||||||
// `__valid`. Newer libstdc++ headers also use those internal names, so keep
|
|
||||||
// the shim's macros from leaking past the DirectXMath include.
|
|
||||||
#ifdef __valid
|
|
||||||
#undef __valid
|
|
||||||
#endif
|
|
||||||
#ifdef __notvalid
|
|
||||||
#undef __notvalid
|
|
||||||
#endif
|
|
||||||
#ifdef __maybevalid
|
|
||||||
#undef __maybevalid
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace DirectX;
|
using namespace DirectX;
|
||||||
|
|
||||||
typedef struct _RECT {
|
typedef struct _RECT {
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#ifdef __valid
|
|
||||||
#pragma push_macro("__valid")
|
|
||||||
#undef __valid
|
|
||||||
#define PERFORMANCE_TIMER_RESTORE_VALID_MACRO
|
|
||||||
#endif
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#ifdef PERFORMANCE_TIMER_RESTORE_VALID_MACRO
|
|
||||||
#pragma pop_macro("__valid")
|
|
||||||
#undef PERFORMANCE_TIMER_RESTORE_VALID_MACRO
|
|
||||||
#endif
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
class PerformanceTimer {
|
class PerformanceTimer {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue