diff --git a/src/initsout.c b/src/initsout.c index e0e3f7a..707bdb8 100644 --- a/src/initsout.c +++ b/src/initsout.c @@ -106,7 +106,7 @@ LispPTR *fixp_value(LispPTR *ptr) { #define PAGES_IN_MBYTE 2048 void init_ifpage(int sysout_size) { - extern long MDate; + extern time_t MDate; extern int DisplayType; extern int Storage_expanded; int new_lastvmem; @@ -174,8 +174,8 @@ are null terminated instead */ } #endif /* DOS */ - /* sec from Oct-13-87 12:00 It's My birthday(take) */ - /* MDate may be set by makefile(by mkvdate.c) */ + /* Days from Oct-13-87 12:00 It's Takeshi's birthday. */ + /* MDate may be set by vdate.c, generated by mkvdate.c. */ InterfacePage->rversion = (MDate - 561150000) / (60 * 60 * 24); /* For DisplayType ,I couldn't insert this line into init_display */ diff --git a/src/main.c b/src/main.c index 4f0a5f9..2e09aac 100644 --- a/src/main.c +++ b/src/main.c @@ -260,7 +260,7 @@ int flushing = FALSE; /* see dbprint.h if set, all debug/trace printing will cal extern DspInterface currentdsp; #endif /* DOS || XWINDOW */ -extern long MDate; +extern time_t MDate; extern int nokbdflag; extern int nomouseflag; #ifdef DOS @@ -736,11 +736,7 @@ void print_info_lines() { #elif (RELEASE == 351) printf("Emulator for Medley release 3.51\n"); #endif /* RELEASE */ -#if defined(MACOSX) || defined(FREEBSD) || defined(LINUX) - printf("Creation date: %s", ctime((const time_t *)&MDate)); -#else printf("Creation date: %s", ctime(&MDate)); -#endif #ifdef LPSOLVE printf("Contains lp_solve LP solver.\n"); #endif /* LPSOLVE */ diff --git a/src/mkvdate.c b/src/mkvdate.c index ee1605a..6673503 100644 --- a/src/mkvdate.c +++ b/src/mkvdate.c @@ -19,8 +19,11 @@ /* InterfacePage->rversion. The version number is the number */ /* of whole days since 12:00 13-Oct-87 (Takeshi's birthday). */ /* */ -/* This program prints a single line: */ -/* long MDate = */ +/* This program prints a single line, with seconds since Unix */ +/* epoch, which is converted to days since Takeshi's birthday in */ +/* initsout.c: */ +/* */ +/* time_t MDate = */ /* */ /* That output is redirected to create the file vdate.c, which */ /* is then compiled as part of the emulator MAKE. */ @@ -39,7 +42,7 @@ int main(void) { long dtime; time(&dtime); - fprintf(stderr, "Mdate :%ld\n", dtime); + fprintf(stderr, "MDate: %ld\n", dtime); printf("long MDate= %ld;\n", dtime); return (0); } @@ -48,11 +51,17 @@ int main(void) { int main(void) { struct timeval time; + /* On some Unix platforms, time_t is an int and on + * others, it is a long. We'll store it as a time_t, + * but print it as a long so that we can avoid format + * warnings about differing sized types. + */ gettimeofday(&time, NULL); - fprintf(stderr, "Mdate :%ld\n", (long)time.tv_sec); + fprintf(stderr, "MDate: %ld\n", (long)time.tv_sec); fprintf(stderr, "Version: %s\n", ctime(&time.tv_sec)); - printf("long MDate= %ld;\n", (long)time.tv_sec); + printf("#include \n"); + printf("time_t MDate= %ld;\n", (long)time.tv_sec); return (0); }