mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-07 16:06:16 +02:00
+ support setpeoptflags directive, resolves #23447
git-svn-id: trunk@23132 -
This commit is contained in:
parent
d180d6f241
commit
db68214e88
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -13014,6 +13014,7 @@ tests/webtbs/tw2328.pp svneol=native#text/plain
|
||||
tests/webtbs/tw2332.pp svneol=native#text/plain
|
||||
tests/webtbs/tw23342.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw23436.pp svneol=native#text/plain
|
||||
tests/webtbs/tw23447.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw2351.pp svneol=native#text/plain
|
||||
tests/webtbs/tw2363.pp svneol=native#text/plain
|
||||
tests/webtbs/tw2377.pp svneol=native#text/plain
|
||||
|
@ -260,6 +260,7 @@ interface
|
||||
usewindowapi : boolean;
|
||||
description : string;
|
||||
SetPEFlagsSetExplicity,
|
||||
SetPEOptFlagsSetExplicity,
|
||||
ImageBaseSetExplicity,
|
||||
MinStackSizeSetExplicity,
|
||||
MaxStackSizeSetExplicity,
|
||||
@ -269,6 +270,7 @@ interface
|
||||
dllminor,
|
||||
dllrevision : word; { revision only for netware }
|
||||
{ win pe }
|
||||
peoptflags,
|
||||
peflags : longint;
|
||||
minstacksize,
|
||||
maxstacksize,
|
||||
@ -1605,6 +1607,7 @@ implementation
|
||||
description:='Compiled by FPC '+version_string+' - '+target_cpu_string;
|
||||
DescriptionSetExplicity:=false;
|
||||
SetPEFlagsSetExplicity:=false;
|
||||
SetPEOptFlagsSetExplicity:=false;
|
||||
ImageBaseSetExplicity:=false;
|
||||
MinStackSizeSetExplicity:=false;
|
||||
MaxStackSizeSetExplicity:=false;
|
||||
|
@ -386,6 +386,8 @@ scan_w_unavailable_system_codepage=02091_W_Current system codepage "$1" is not a
|
||||
% The compiler is compiled with support for several codepages built-in.
|
||||
% The codepage of the operation system is not in that list. You will need to recompile
|
||||
% the compiler with support for this codepage.
|
||||
scan_w_setpeoptflags_not_support=02092_W_SETPEOPTFLAGS is not supported by the target OS
|
||||
% The \var{\{\$SETPEOPTFLAGS\}} directive is not supported by the target OS.
|
||||
% \end{description}
|
||||
#
|
||||
# Parser
|
||||
|
@ -113,6 +113,7 @@ const
|
||||
scanner_f_illegal_utf8_bom=02089;
|
||||
scanner_w_directive_ignored_on_target=02090;
|
||||
scan_w_unavailable_system_codepage=02091;
|
||||
scan_w_setpeoptflags_not_support=02092;
|
||||
parser_e_syntax_error=03000;
|
||||
parser_e_dont_nest_interrupt=03004;
|
||||
parser_w_proc_directive_ignored=03005;
|
||||
@ -961,9 +962,9 @@ const
|
||||
option_info=11024;
|
||||
option_help_pages=11025;
|
||||
|
||||
MsgTxtSize = 67940;
|
||||
MsgTxtSize = 67996;
|
||||
|
||||
MsgIdxMax : array[1..20] of longint=(
|
||||
26,92,328,120,87,56,125,26,202,63,
|
||||
26,93,328,120,87,56,125,26,202,63,
|
||||
54,20,1,1,1,1,1,1,1,1
|
||||
);
|
||||
|
1202
compiler/msgtxt.inc
1202
compiler/msgtxt.inc
File diff suppressed because it is too large
Load Diff
@ -2309,7 +2309,12 @@ const pemagic : array[0..3] of byte = (
|
||||
peoptheader.Subsystem:=PE_SUBSYSTEM_WINDOWS_GUI
|
||||
else
|
||||
peoptheader.Subsystem:=PE_SUBSYSTEM_WINDOWS_CUI;
|
||||
peoptheader.DllCharacteristics:=0;
|
||||
|
||||
if SetPEOptFlagsSetExplicity then
|
||||
peoptheader.DllCharacteristics:=peoptflags
|
||||
else
|
||||
peoptheader.DllCharacteristics:=0;
|
||||
|
||||
peoptheader.SizeOfStackReserve:=stacksize;
|
||||
peoptheader.SizeOfStackCommit:=$1000;
|
||||
if MinStackSizeSetExplicity then
|
||||
|
@ -1089,10 +1089,19 @@ unit scandir;
|
||||
if not (target_info.system in (systems_all_windows)) then
|
||||
Message(scan_w_setpeflags_not_support);
|
||||
current_scanner.skipspace;
|
||||
peflags:=current_scanner.readval;
|
||||
peflags:=peflags or current_scanner.readval;
|
||||
SetPEFlagsSetExplicity:=true;
|
||||
end;
|
||||
|
||||
procedure dir_setpeoptflags;
|
||||
begin
|
||||
if not (target_info.system in (systems_all_windows)) then
|
||||
Message(scan_w_setpeoptflags_not_support);
|
||||
current_scanner.skipspace;
|
||||
peoptflags:=peoptflags or current_scanner.readval;
|
||||
SetPEOptFlagsSetExplicity:=true;
|
||||
end;
|
||||
|
||||
procedure dir_smartlink;
|
||||
begin
|
||||
do_moduleswitch(cs_create_smart);
|
||||
@ -1573,6 +1582,7 @@ unit scandir;
|
||||
AddDirective('SAFEFPUEXCEPTIONS',directive_all, @dir_safefpuexceptions);
|
||||
AddDirective('SCOPEDENUMS',directive_all, @dir_scopedenums);
|
||||
AddDirective('SETPEFLAGS', directive_all, @dir_setpeflags);
|
||||
AddDirective('SETPEOPTFLAGS', directive_all, @dir_setpeoptflags);
|
||||
AddDirective('SCREENNAME',directive_all, @dir_screenname);
|
||||
AddDirective('SMARTLINK',directive_all, @dir_smartlink);
|
||||
AddDirective('STACKFRAMES',directive_all, @dir_stackframes);
|
||||
|
6
tests/webtbs/tw23447.pp
Normal file
6
tests/webtbs/tw23447.pp
Normal file
@ -0,0 +1,6 @@
|
||||
{ %target=win32,win64,wince }
|
||||
{ %opt=-Sew }
|
||||
{$setpeoptflags $0140}
|
||||
begin
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user