Skip to content

Commit

Permalink
Support building ltests.c in MODE=dbg
Browse files Browse the repository at this point in the history
Fixes #1226
  • Loading branch information
jart committed Dec 13, 2024
1 parent 838b54f commit 69402f4
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 16 deletions.
46 changes: 30 additions & 16 deletions third_party/lua/ltests.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,39 @@
#define ltests_c
#define LUA_CORE

#include "third_party/lua/lapi.h"
#include "third_party/lua/lauxlib.h"
#include "third_party/lua/lcode.h"
#include "third_party/lua/lctype.h"
#include "third_party/lua/ldebug.h"
#include "third_party/lua/ldo.h"
#include "third_party/lua/lfunc.h"
#include "third_party/lua/lmem.h"
#include "third_party/lua/lopcodes.h"
#include "third_party/lua/lopnames.inc"
#include "third_party/lua/lprefix.h"
#include "third_party/lua/lstate.h"
#include "third_party/lua/lstring.h"
#include "third_party/lua/ltable.h"
#include "third_party/lua/lua.h"
#include "third_party/lua/lualib.h"
#include "lprefix.h"

#include <limits.h>
#include <setjmp.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "libc/mem/gc.h"
#include "libc/log/log.h"

#include "lua.h"

#include "lapi.h"
#include "lauxlib.h"
#include "lcode.h"
#include "lctype.h"
#include "ldebug.h"
#include "ldo.h"
#include "lfunc.h"
#include "lmem.h"
#include "lopcodes.h"
#include "lopnames.inc"
#include "lprefix.h"
#include "lstate.h"
#include "lstring.h"
#include "ltable.h"
#include "lualib.h"
#include "ltm.h"

__static_yoink("lua_notice");



/*
** The whole module only makes sense with LUA_DEBUG on
*/
Expand Down
8 changes: 8 additions & 0 deletions third_party/lua/lua.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,14 @@ typedef struct lua_Debug lua_Debug;
typedef void (*lua_Hook) (lua_State *L, lua_Debug *ar);


/*
** [jart] support ltests.h without unsafe LUA_USER_H kludge
** use `make MODE=dbg` to get this functionality
*/
#ifdef MODE_DBG
#include "ltests.h"
#endif

/*
** generic extra include file
*/
Expand Down

0 comments on commit 69402f4

Please sign in to comment.