mirror of
https://github.com/cc65/cc65.git
synced 2025-02-25 01:29:04 +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:
parent
6676e27032
commit
7215ebd145
@ -6,7 +6,7 @@
|
|||||||
/* */
|
/* */
|
||||||
/* */
|
/* */
|
||||||
/* */
|
/* */
|
||||||
/* (C) 2000-2001 Ullrich von Bassewitz */
|
/* (C) 2000-2002 Ullrich von Bassewitz */
|
||||||
/* Wacholderweg 14 */
|
/* Wacholderweg 14 */
|
||||||
/* D-70597 Stuttgart */
|
/* D-70597 Stuttgart */
|
||||||
/* EMail: uz@cc65.org */
|
/* EMail: uz@cc65.org */
|
||||||
@ -34,9 +34,11 @@
|
|||||||
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
/* common */
|
/* common */
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
#include "xmalloc.h"
|
||||||
|
|
||||||
/* cc65 */
|
/* cc65 */
|
||||||
#include "asmlabel.h"
|
#include "asmlabel.h"
|
||||||
@ -255,8 +257,10 @@ static void Parse (void)
|
|||||||
void Compile (const char* FileName)
|
void Compile (const char* FileName)
|
||||||
/* Top level compile routine. Will setup things and call the parser. */
|
/* 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 */
|
/* Add some standard paths to the include search path */
|
||||||
AddIncludePath ("", INC_USER); /* Current directory */
|
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 */
|
/* Initialize the literal pool */
|
||||||
InitLiteralPool ();
|
InitLiteralPool ();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user