Fix Lunatic build on Windows.

- Make _buildargv[_buildargc] NULL.
- With SDL layer, pass argv and argc directly and get rid of _build* ones.
- Add tilesiz* to dynsymlists.

git-svn-id: https://svn.eduke32.com/eduke32@3573 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2013-03-18 22:05:21 +00:00
parent 38ee330c93
commit c397759217
6 changed files with 9 additions and 14 deletions

View file

@ -14,9 +14,6 @@ extern "C" {
#define SYSTEM_POOL_SIZE (64 * 1048576) #define SYSTEM_POOL_SIZE (64 * 1048576)
extern int32_t _buildargc;
extern const char **_buildargv;
extern char quitevent, appactive; extern char quitevent, appactive;
extern int32_t vsync; extern int32_t vsync;

View file

@ -70,8 +70,6 @@ int32_t startwin_settitle(const char *s) { UNREFERENCED_PARAMETER(s); return 0;
#define MWHEELTICKS 10 #define MWHEELTICKS 10
static uint32_t mwheelup, mwheeldown; static uint32_t mwheelup, mwheeldown;
int32_t _buildargc = 1;
const char **_buildargv = NULL;
extern int32_t app_main(int32_t argc, const char *argv[]); extern int32_t app_main(int32_t argc, const char *argv[]);
char quitevent=0, appactive=1, novideo=0; char quitevent=0, appactive=1, novideo=0;
@ -231,9 +229,6 @@ int32_t main(int32_t argc, char *argv[])
#endif #endif
startwin_open(); startwin_open();
_buildargc = argc;
_buildargv = (const char **)argv;
maybe_redirect_outputs(); maybe_redirect_outputs();
#ifdef USE_OPENGL #ifdef USE_OPENGL
@ -242,7 +237,7 @@ int32_t main(int32_t argc, char *argv[])
#endif #endif
baselayer_init(); baselayer_init();
r = app_main(_buildargc, _buildargv); r = app_main(argc, argv);
startwin_close(); startwin_close();
#ifdef HAVE_GTK2 #ifdef HAVE_GTK2

View file

@ -78,8 +78,8 @@
static mutex_t m_initprintf; static mutex_t m_initprintf;
static int32_t winlayer_have_ATI = 0; static int32_t winlayer_have_ATI = 0;
int32_t _buildargc = 0; static int32_t _buildargc = 0;
const char **_buildargv = NULL; static const char **_buildargv = NULL;
static char *argvbuf = NULL; static char *argvbuf = NULL;
extern int32_t app_main(int32_t argc, const char **argv); extern int32_t app_main(int32_t argc, const char **argv);
@ -413,13 +413,14 @@ int32_t WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmdLine, in
} }
*wp = 0; *wp = 0;
_buildargv = (const char **)Bmalloc(sizeof(char *)*_buildargc); _buildargv = (const char **)Bmalloc(sizeof(char *)*(_buildargc+1));
wp = argvbuf; wp = argvbuf;
for (i=0; i<_buildargc; i++,wp++) for (i=0; i<_buildargc; i++,wp++)
{ {
_buildargv[i] = wp; _buildargv[i] = wp;
while (*wp) wp++; while (*wp) wp++;
} }
_buildargv[_buildargc] = NULL;
} }
maybe_redirect_outputs(); maybe_redirect_outputs();

View file

@ -8687,8 +8687,6 @@ static int32_t loaddefinitions_game(const char *fn, int32_t preload)
} }
#ifdef LUNATIC #ifdef LUNATIC
// TODO: In Windows, argv[argc] isn't NULL as demanded by C99. (See winlayer.c:
// "carve up...").
const char **g_argv; const char **g_argv;
#endif #endif

View file

@ -40,6 +40,8 @@ prevspritesect;
prevspritestat; prevspritestat;
nextspritesect; nextspritesect;
nextspritestat; nextspritestat;
tilesizx;
tilesizy;
headsectbunch; headsectbunch;
nextsectbunch; nextsectbunch;

View file

@ -40,6 +40,8 @@ prevspritesect;
prevspritestat; prevspritestat;
nextspritesect; nextspritesect;
nextspritestat; nextspritestat;
tilesizx;
tilesizy;
headsectbunch; headsectbunch;
nextsectbunch; nextsectbunch;