From 6a2c9dc8f7b25e99e23e20462ce1dfb94fa57751 Mon Sep 17 00:00:00 2001 From: William McBrine Date: Fri, 11 Jan 2019 18:32:15 -0500 Subject: [PATCH] Build SDL2 demos in "Windows" mode (i.e. no controlling terminal) with MSVC, as with MinGW. --- sdl2/Makefile.vc | 11 ++++++----- sdl2/sdltest.c | 2 -- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/sdl2/Makefile.vc b/sdl2/Makefile.vc index 5d9eaea9..3b1c84b1 100644 --- a/sdl2/Makefile.vc +++ b/sdl2/Makefile.vc @@ -52,7 +52,7 @@ INFOPT = -DHAVE_NO_INFOEX SHL_LD = link $(LDFLAGS) -nologo -dll -machine:$(PLATFORM) -out:pdcurses.dll -LINK = link.exe -nologo +LINK = link.exe -nologo -subsystem:windows LIBEXE = lib -nologo @@ -62,7 +62,8 @@ CURSESDLL = pdcurses.dll !ifdef DLL DLLOPT = -DPDC_DLL_BUILD PDCLIBS = $(CURSESDLL) -LIBLIBS = $(SDL2_LIBMAIN) $(SDL2_LIB) $(TTF_LIB) +LIBLIBS = $(SDL2_LIB) $(TTF_LIB) +CCLIBS = $(SDL2_LIBMAIN) $(SDL2_LIB) !else PDCLIBS = $(LIBCURSES) CCLIBS = $(SDL2_LIBMAIN) $(SDL2_LIB) $(TTF_LIB) @@ -107,10 +108,10 @@ pdcurses.res pdcurses.obj: $(common)\pdcurses.rc $(BUILD) $< {$(osdir)\}.c{}.obj:: - $(BUILD) $(SDL2_INCLUDE) $(TTF_INCLUDE) $< + $(BUILD) -Dmain=SDL_main $(SDL2_INCLUDE) $(TTF_INCLUDE) $< {$(demodir)\}.c{}.obj:: - $(BUILD) $< + $(BUILD) -Dmain=SDL_main $< .obj.exe: $(LINK) $(LDFLAGS) $< $(LIBCURSES) $(CCLIBS) @@ -122,7 +123,7 @@ tui.obj: $(demodir)\tui.c $(demodir)\tui.h $(BUILD) -I$(demodir) $(demodir)\tui.c tuidemo.obj: $(demodir)\tuidemo.c - $(BUILD) -I$(demodir) $(demodir)\tuidemo.c + $(BUILD) -Dmain=SDL_main -I$(demodir) $(demodir)\tuidemo.c sdltest.exe: sdltest.obj $(LINK) $(LDFLAGS) $*.obj $(LIBCURSES) $(LIBLIBS) $(CCLIBS) diff --git a/sdl2/sdltest.c b/sdl2/sdltest.c index 9dc0c2c1..dfcdac4f 100644 --- a/sdl2/sdltest.c +++ b/sdl2/sdltest.c @@ -3,8 +3,6 @@ (assuming the default 8x16 font) stdscr at the bottom. */ -#define SDL_MAIN_HANDLED - #include #include #include