From 76345fb40cbd91030ce06923bcdb9753b7e25751 Mon Sep 17 00:00:00 2001 From: "nethack.allison" Date: Fri, 5 Jan 2007 23:08:46 +0000 Subject: [PATCH] win32 build - force time_t to be 32 bits via Makefile. (If struct u gets changed to not store a time_t field, this can be removed). - Latest Windows SDK (supporting Vista) causes a warning due to a prototype in sys/winnt/nttty. Since we don't actually link with that function and rely on a DLL find procedure at run time, comment out the prototype. The function is now officially in the SDK in the windows header files anyway. --- sys/winnt/Makefile.msc | 18 ++++++++++++------ sys/winnt/nttty.c | 2 +- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/sys/winnt/Makefile.msc b/sys/winnt/Makefile.msc index 414340c39..7e04f929f 100644 --- a/sys/winnt/Makefile.msc +++ b/sys/winnt/Makefile.msc @@ -1,5 +1,5 @@ # SCCS Id: @(#)Makefile.msc 3.5 $Date$ -# Copyright (c) NetHack PC Development Team 1993-2006 +# Copyright (c) NetHack PC Development Team 1993-2007 # # NetHack 3.5.x Makefile for MS Visual C++ # @@ -218,7 +218,8 @@ cdebug = -Zi -Od # Util builds #========================================== -cflagsUtil = $(cdebug) $(cflags) $(INCLDIR) $(WINPFLAG) $(DLBFLG) +cflagsUtil = $(cdebug) $(cflags) /D_USE_32BIT_TIME_T $(INCLDIR) \ + $(WINPFLAG) $(DLBFLG) lflagsUtil = $(ldebug) $(lflags) $(conlibs) #========================================== @@ -231,14 +232,14 @@ LIBS= user32.lib winmm.lib $(ZLIB) !IF ("$(GRAPHICAL)"=="Y") -cflagsGame = $(cdebug) $(cflags) $(guiflags) $(INCLDIR) $(WINPFLAG) $(DLBFLG) \ - $(GAMEPDBFILE) $(GAMEMAPFILE) +cflagsGame = $(cdebug) $(cflags) /D_USE_32BIT_TIME_T $(guiflags) $(INCLDIR) \ + $(WINPFLAG) $(DLBFLG) $(GAMEPDBFILE) $(GAMEMAPFILE) lflagsGame = $(ldebug) $(lflags) $(guilibs) !ELSE -cflagsGame = $(cdebug) $(cflags) $(conflags) $(INCLDIR) $(WINPFLAG) $(DLBFLG) \ - $(GAMEPDBFILE) $(GAMEMAPFILE) +cflagsGame = $(cdebug) $(cflags) /D_USE_32BIT_TIME_T $(conflags) $(INCLDIR) \ + $(WINPFLAG) $(DLBFLG) $(GAMEPDBFILE) $(GAMEMAPFILE) lflagsGame = $(ldebug) $(lflags) $(conlibs) !ENDIF @@ -677,6 +678,11 @@ $(GAMEDIR)\nhraykey.dll : $(O)$(@B).o $(O)gamedir.tag $(O)$(@B).def #========================================== # Makedefs Stuff #========================================== +$(U)nhsizes.exe: $(O)nhsizes.o + $(link) $(lflagsUtil) -out:$@ $(O)nhsizes.o $(O)panic.o $(O)alloc.o + +$(O)nhsizes.o: $(CONFIG_H) nhsizes.c + $(CC) $(cflagsUtil) -Fo$@ nhsizes.c $(U)makedefs.exe: $(MAKEOBJS) $(link) $(lflagsUtil) /PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).MAP" -out:$@ $(MAKEOBJS) diff --git a/sys/winnt/nttty.c b/sys/winnt/nttty.c index 368c42af9..24bacbcf4 100644 --- a/sys/winnt/nttty.c +++ b/sys/winnt/nttty.c @@ -1336,7 +1336,7 @@ adjust_palette(VOID_ARGS) /* /* only in Win2k+ (use FindWindow for NT4) */ -HWND WINAPI GetConsoleWindow(); +/* HWND WINAPI GetConsoleWindow(); */ /* Undocumented console message */ #define WM_SETCONSOLEINFO (WM_USER+201)