mirror of
https://github.com/ChaiScript/ChaiScript.git
synced 2026-06-15 08:26:16 +08:00
Address review: use CHAISCRIPT_DEBUG instead of _DEBUG
Switch CHAISCRIPT_DEBUG from a true/false definition to 1/0 so it can be used in preprocessor #if expressions, then reuse it for the MSVC Debug guard around CHAISCRIPT_MAX_CALL_DEPTH instead of testing the compiler-private _DEBUG macro directly. The C++ debug_build constant keeps its bool value through implicit conversion. Requested by @lefticus in PR #700 review. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
ec05fcf3d4
commit
bd6fd1f237
@ -70,9 +70,9 @@ static_assert(_MSC_FULL_VER >= 190024210, "Visual C++ 2015 Update 3 or later req
|
||||
#endif
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define CHAISCRIPT_DEBUG true
|
||||
#define CHAISCRIPT_DEBUG 1
|
||||
#else
|
||||
#define CHAISCRIPT_DEBUG false
|
||||
#define CHAISCRIPT_DEBUG 0
|
||||
#endif
|
||||
|
||||
// Upper bound on the depth of nested ChaiScript function calls. Hitting it
|
||||
@ -86,7 +86,7 @@ static_assert(_MSC_FULL_VER >= 190024210, "Visual C++ 2015 Update 3 or later req
|
||||
// MSVC Release build overflows the native stack before the depth check fires.
|
||||
// We pick a tighter default in that configuration to keep the throw reachable.
|
||||
#ifndef CHAISCRIPT_MAX_CALL_DEPTH
|
||||
#if defined(CHAISCRIPT_MSVC) && defined(_DEBUG)
|
||||
#if defined(CHAISCRIPT_MSVC) && CHAISCRIPT_DEBUG
|
||||
#define CHAISCRIPT_MAX_CALL_DEPTH 32
|
||||
#else
|
||||
#define CHAISCRIPT_MAX_CALL_DEPTH 256
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user