|
@@ -1743,6 +1743,7 @@ In case not, the value returned can be arbitrary.
|
|
args : string;
|
|
args : string;
|
|
hp : tinputfile;
|
|
hp : tinputfile;
|
|
found : boolean;
|
|
found : boolean;
|
|
|
|
+ macroIsString : boolean;
|
|
begin
|
|
begin
|
|
current_scanner.skipspace;
|
|
current_scanner.skipspace;
|
|
args:=current_scanner.readcomment;
|
|
args:=current_scanner.readcomment;
|
|
@@ -1760,6 +1761,7 @@ In case not, the value returned can be arbitrary.
|
|
{ save old }
|
|
{ save old }
|
|
path:=hs;
|
|
path:=hs;
|
|
{ first check for internal macros }
|
|
{ first check for internal macros }
|
|
|
|
+ macroIsString:=true;
|
|
if hs='TIME' then
|
|
if hs='TIME' then
|
|
hs:=gettimestr
|
|
hs:=gettimestr
|
|
else
|
|
else
|
|
@@ -1771,6 +1773,12 @@ In case not, the value returned can be arbitrary.
|
|
else
|
|
else
|
|
if hs='LINE' then
|
|
if hs='LINE' then
|
|
hs:=tostr(current_filepos.line)
|
|
hs:=tostr(current_filepos.line)
|
|
|
|
+ else
|
|
|
|
+ if hs='LINENUM' then
|
|
|
|
+ begin
|
|
|
|
+ hs:=tostr(current_filepos.line);
|
|
|
|
+ macroIsString:=false;
|
|
|
|
+ end
|
|
else
|
|
else
|
|
if hs='FPCVERSION' then
|
|
if hs='FPCVERSION' then
|
|
hs:=version_string
|
|
hs:=version_string
|
|
@@ -1791,9 +1799,10 @@ In case not, the value returned can be arbitrary.
|
|
if hs='' then
|
|
if hs='' then
|
|
Message1(scan_w_include_env_not_found,path);
|
|
Message1(scan_w_include_env_not_found,path);
|
|
{ make it a stringconst }
|
|
{ make it a stringconst }
|
|
- hs:=''''+hs+'''';
|
|
|
|
|
|
+ if macroIsString then
|
|
|
|
+ hs:=''''+hs+'''';
|
|
current_scanner.insertmacro(path,@hs[1],length(hs),
|
|
current_scanner.insertmacro(path,@hs[1],length(hs),
|
|
- current_scanner.line_no,current_scanner.inputfile.ref_index);
|
|
|
|
|
|
+ current_scanner.line_no,current_scanner.inputfile.ref_index);
|
|
end
|
|
end
|
|
else
|
|
else
|
|
begin
|
|
begin
|