1.1 --- a/compiler-init/sc1.c Fri Jul 14 04:24:42 2006 +0000
1.2 +++ b/compiler-init/sc1.c Fri Jul 14 04:51:58 2006 +0000
1.3 @@ -61,6 +61,8 @@
1.4 #include <windows.h>
1.5 #endif
1.6
1.7 +#include <time.h>
1.8 +
1.9 #include "lstring.h"
1.10 #include "sc.h"
1.11 #include "svnrev.h"
1.12 @@ -130,6 +132,7 @@
1.13 static void addwhile(int *ptr);
1.14 static void delwhile(void);
1.15 static int *readwhile(void);
1.16 +static void inst_datetime_defines(void);
1.17
1.18 static int norun = 0; /* the compiler never ran */
1.19 static int lastst = 0; /* last executed statement type */
1.20 @@ -305,6 +308,7 @@
1.21 delete_symbols(&glbtab,0,TRUE,FALSE);
1.22 #if !defined NO_DEFINE
1.23 delete_substtable();
1.24 + inst_datetime_defines();
1.25 #endif
1.26 resetglobals();
1.27 sc_ctrlchar=sc_ctrlchar_org;
1.28 @@ -369,6 +373,7 @@
1.29 delete_symbols(&glbtab,0,TRUE,FALSE);
1.30 #if !defined NO_DEFINE
1.31 delete_substtable();
1.32 + inst_datetime_defines();
1.33 #endif
1.34 resetglobals();
1.35 sc_ctrlchar=sc_ctrlchar_org;
1.36 @@ -522,6 +527,22 @@
1.37 return 1;
1.38 }
1.39
1.40 +static void inst_datetime_defines(void)
1.41 +{
1.42 + char date[64];
1.43 + char ltime[64];
1.44 + time_t td;
1.45 + struct tm *curtime;
1.46 +
1.47 + time(&td);
1.48 + curtime = localtime(&td);
1.49 + strftime(date, 31, "\"%m/%d%Y\"", curtime);
1.50 + strftime(ltime, 31, "\"%H:%M:%S\"", curtime);
1.51 +
1.52 + insert_subst("__DATE__", date, 8);
1.53 + insert_subst("__TIME__", ltime, 8);
1.54 +}
1.55 +
1.56 #if defined __cplusplus
1.57 extern "C"
1.58 #endif
1.59 @@ -1041,7 +1062,7 @@
1.60 #elif defined LINUX || defined __FreeBSD__ || defined __OpenBSD__
1.61 /* see www.autopackage.org for the BinReloc module */
1.62 br_init_lib(NULL);
1.63 - ptr=br_find_exe("/opt/pawn/bin/pawncc");
1.64 + ptr=br_find_exe("spcomp");
1.65 strlcpy(path,ptr,sizeof path);
1.66 free(ptr);
1.67 #else
1.68 @@ -3199,7 +3220,9 @@
1.69 if ((sym->usage & (uPROTOTYPED | uREAD))==uREAD && sym->tag!=0) {
1.70 int curstatus=sc_status;
1.71 sc_status=statWRITE; /* temporarily set status to WRITE, so the warning isn't blocked */
1.72 +#if 0 /* SourceMod - silly, should be removed in first pass, so removed */
1.73 error(208);
1.74 +#endif
1.75 sc_status=curstatus;
1.76 sc_reparse=TRUE; /* must add another pass to "initial scan" phase */
1.77 } /* if */
1.78 @@ -3331,7 +3354,11 @@
1.79 {
1.80 int result,level,i;
1.81
1.82 +#if 0 /* SourceMod uses case insensitive args for forwards */
1.83 result= strcmp(a1->name,a2->name)==0; /* name */
1.84 +#else
1.85 + result=1;
1.86 +#endif
1.87 if (result)
1.88 result= a1->ident==a2->ident; /* type/class */
1.89 if (result)