1
0
mirror of https://github.com/cc65/cc65.git synced 2024-11-19 06:31:31 +00:00

Added the __DATE__ and __TIME__ preprocessor macros

git-svn-id: svn://svn.cc65.org/cc65/trunk@1403 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2002-09-23 21:37:15 +00:00
parent 6676e27032
commit 7215ebd145

View File

@ -6,7 +6,7 @@
/* */
/* */
/* */
/* (C) 2000-2001 Ullrich von Bassewitz */
/* (C) 2000-2002 Ullrich von Bassewitz */
/* Wacholderweg 14 */
/* D-70597 Stuttgart */
/* EMail: uz@cc65.org */
@ -34,9 +34,11 @@
#include <stdlib.h>
#include <time.h>
/* common */
#include "version.h"
#include "xmalloc.h"
/* cc65 */
#include "asmlabel.h"
@ -255,8 +257,10 @@ static void Parse (void)
void Compile (const char* FileName)
/* Top level compile routine. Will setup things and call the parser. */
{
char* Path;
char* Path;
char Buf[16];
time_t Time;
char* TimeStr;
/* Add some standard paths to the include search path */
AddIncludePath ("", INC_USER); /* Current directory */
@ -293,6 +297,14 @@ void Compile (const char* FileName)
}
}
/* __TIME__ and __DATE__ macros */
Time = time (0);
TimeStr = ctime (&Time);
sprintf (Buf, "\"%.10s\"", TimeStr);
DefineTextMacro ("__DATE__", Buf);
sprintf (Buf, "\"%.15s\"", TimeStr+11);
DefineTextMacro ("__TIME__", Buf);
/* Initialize the literal pool */
InitLiteralPool ();