Skip to content

Commit 7454d2f

Browse files
Sunrisepeakclaude
andcommitted
fix: Lua 5.4 removed LUA_GCSETPAUSE and LUA_GCSETSTEPMUL
These GC option constants were removed in Lua 5.4 (replaced by LUA_GCGEN/LUA_GCINC). Use #ifdef guards for all version-specific GC constants to support both Lua 5.3 and 5.4. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 2cf3c2b commit 7454d2f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/capi/lua.cppm

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,19 @@ inline constexpr int GCCOLLECT = LUA_GCCOLLECT;
9999
inline constexpr int GCCOUNT = LUA_GCCOUNT;
100100
inline constexpr int GCCOUNTB = LUA_GCCOUNTB;
101101
inline constexpr int GCSTEP = LUA_GCSTEP;
102+
#ifdef LUA_GCSETPAUSE
102103
inline constexpr int GCSETPAUSE = LUA_GCSETPAUSE;
104+
#endif
105+
#ifdef LUA_GCSETSTEPMUL
103106
inline constexpr int GCSETSTEPMUL = LUA_GCSETSTEPMUL;
107+
#endif
104108
inline constexpr int GCISRUNNING = LUA_GCISRUNNING;
109+
#ifdef LUA_GCGEN
105110
inline constexpr int GCGEN = LUA_GCGEN;
111+
#endif
112+
#ifdef LUA_GCINC
106113
inline constexpr int GCINC = LUA_GCINC;
114+
#endif
107115

108116
// ============================================================================
109117
// Constants — Hook Masks

0 commit comments

Comments
 (0)