remove time_t from struct you (trunk only)

There was an issue reported where save files between different
versions of a manufacturer's compiler were incompatible because the time_t
ubirthday field was changed from 32 bits to 64 bits.

32 bit time_t implementations will break at 19:14:07 on  January 18, 2038.
64 bit time_t implementations will break at 23:59:59 on December 31, 3000.

This removes the dependency on the size of time_t from the save file.
The ubirthday field is no longer embedded in struct you.
This also adds two general purpose routines to hacklib.c, one to convert a time
value to a 14 character char representation and the other to convert that
back to time_t. Those are used by the save/restore routines.

This is a savefile breaking change, so editlevel in patchlevel.h was
incremented.
This commit is contained in:
nethack.allison
2007-12-19 03:19:25 +00:00
parent faa3543063
commit d430db0718
15 changed files with 99 additions and 13 deletions

View File

@@ -218,7 +218,7 @@ cdebug = -Zi -Od
# Util builds
#==========================================
cflagsUtil = $(cdebug) $(cflags) /D_USE_32BIT_TIME_T $(INCLDIR) \
cflagsUtil = $(cdebug) $(cflags) $(INCLDIR) \
$(WINPFLAG) $(DLBFLG)
lflagsUtil = $(ldebug) $(lflags) $(conlibs)
@@ -232,13 +232,13 @@ LIBS= user32.lib winmm.lib $(ZLIB)
!IF ("$(GRAPHICAL)"=="Y")
cflagsGame = $(cdebug) $(cflags) /D_USE_32BIT_TIME_T $(guiflags) $(INCLDIR) \
cflagsGame = $(cdebug) $(cflags) $(guiflags) $(INCLDIR) \
$(WINPFLAG) $(DLBFLG) $(GAMEPDBFILE) $(GAMEMAPFILE)
lflagsGame = $(ldebug) $(lflags) $(guilibs)
!ELSE
cflagsGame = $(cdebug) $(cflags) /D_USE_32BIT_TIME_T $(conflags) $(INCLDIR) \
cflagsGame = $(cdebug) $(cflags) $(conflags) $(INCLDIR) \
$(WINPFLAG) $(DLBFLG) $(GAMEPDBFILE) $(GAMEMAPFILE)
lflagsGame = $(ldebug) $(lflags) $(conlibs)