mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-28 11:03:49 +00:00
Fix TORQUE_UNUSED for recent versions of MSVC
Since there's now apparently no way to suppress the warning for a particular variable without adding at least some extra size to the executable, just turn the warning off in release builds. We leave it on in debug since it can sometimes help catch bugs, and we don't care about a little extra code in that configuration.
This commit is contained in:
parent
cc9be50422
commit
e03c3bb34f
1 changed files with 10 additions and 0 deletions
|
|
@ -32,6 +32,16 @@
|
|||
typedef signed _int64 S64;
|
||||
typedef unsigned _int64 U64;
|
||||
|
||||
// The types.h version of TORQUE_UNUSED no longer works for recent versions of MSVC.
|
||||
// Since it appears that MS has made this impossible to do in a zero-overhead way,
|
||||
// just turn the warning off in release builds.
|
||||
#undef TORQUE_UNUSED
|
||||
#ifdef TORQUE_DEBUG
|
||||
#define TORQUE_UNUSED(var) ((0,0) ? (void)(var) : (void)0)
|
||||
#else
|
||||
#pragma warning(disable: 4189) // local variable is initialized but not referenced
|
||||
#define TORQUE_UNUSED(var) ((void)0)
|
||||
#endif
|
||||
|
||||
//--------------------------------------
|
||||
// Compiler Version
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue