Added support for standard predefines ala C++, i.e., __DATE__, __TIME__, __TIMESTAMP__, __FILE__, __LINE__

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2634 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
icemank 2003-06-12 15:09:27 +00:00
parent 1ea2160310
commit 3b0cc4f1c4
4 changed files with 183 additions and 0 deletions

View file

@ -217,6 +217,31 @@ CEXEBuild::CEXEBuild()
include_dirs.add(szNSISDir,0);
}
#ifdef NSIS_SUPPORT_STANDARD_PREDEFINES
// Added by Sunil Kamath 11 June 2003
{
time_t etime;
struct tm * ltime;
SYSTEMTIME stime;
char datebuf[32];
char timebuf[32];
time(&etime);
ltime = localtime(&etime);
stime.wYear = ltime->tm_year+1900;
stime.wMonth = ltime->tm_mon + 1;
stime.wDay = ltime->tm_mday;
stime.wHour= ltime->tm_hour;
stime.wMinute= ltime->tm_min;
stime.wSecond= ltime->tm_sec;
stime.wMilliseconds= 0;
GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &stime, NULL, datebuf, sizeof(datebuf));
definedlist.add("__DATE__",(char *)datebuf);
GetTimeFormat(LOCALE_USER_DEFAULT, 0, &stime, NULL, timebuf, sizeof(timebuf));
definedlist.add("__TIME__",(char *)timebuf);
}
#endif
db_opt_save=db_comp_save=db_full_size=db_opt_save_u=db_comp_save_u=db_full_size_u=0;
// Added by Amir Szekely 31st July 2002