mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-17 20:20:51 +01:00
+ enable omitting of IMPLEMENTATION for mode mac
+ added macro FPC_MAC for mode mac
This commit is contained in:
parent
8d67f439f3
commit
90bf09aa35
@ -750,7 +750,10 @@ implementation
|
|||||||
current_scanner.def_macro('FPC_OBJFPC')
|
current_scanner.def_macro('FPC_OBJFPC')
|
||||||
else
|
else
|
||||||
if (m_gpc in aktmodeswitches) then
|
if (m_gpc in aktmodeswitches) then
|
||||||
current_scanner.def_macro('FPC_GPC');
|
current_scanner.def_macro('FPC_GPC')
|
||||||
|
else
|
||||||
|
if (m_mac in aktmodeswitches) then
|
||||||
|
current_scanner.def_macro('FPC_MAC');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -869,6 +872,7 @@ implementation
|
|||||||
force_init_final : boolean;
|
force_init_final : boolean;
|
||||||
pd : tprocdef;
|
pd : tprocdef;
|
||||||
unitname8 : string[8];
|
unitname8 : string[8];
|
||||||
|
has_impl: boolean;
|
||||||
begin
|
begin
|
||||||
consume(_UNIT);
|
consume(_UNIT);
|
||||||
if compile_level=1 then
|
if compile_level=1 then
|
||||||
@ -1010,9 +1014,16 @@ implementation
|
|||||||
reload_flagged_units;
|
reload_flagged_units;
|
||||||
|
|
||||||
{ Parse the implementation section }
|
{ Parse the implementation section }
|
||||||
consume(_IMPLEMENTATION);
|
if (m_mac in aktmodeswitches) and try_to_consume(_END) then
|
||||||
|
has_impl:= false
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
consume(_IMPLEMENTATION);
|
||||||
|
has_impl:= true;
|
||||||
|
end;
|
||||||
|
|
||||||
Message1(unit_u_loading_implementation_units,current_module.modulename^);
|
if has_impl then
|
||||||
|
Message1(unit_u_loading_implementation_units,current_module.modulename^);
|
||||||
|
|
||||||
parse_only:=false;
|
parse_only:=false;
|
||||||
|
|
||||||
@ -1028,7 +1039,8 @@ implementation
|
|||||||
refsymtable:=st;
|
refsymtable:=st;
|
||||||
|
|
||||||
{ Read the implementation units }
|
{ Read the implementation units }
|
||||||
parse_implementation_uses;
|
if has_impl then
|
||||||
|
parse_implementation_uses;
|
||||||
|
|
||||||
if current_module.state=ms_compiled then
|
if current_module.state=ms_compiled then
|
||||||
exit;
|
exit;
|
||||||
@ -1062,17 +1074,20 @@ implementation
|
|||||||
allow_special:=false;
|
allow_special:=false;
|
||||||
{$endif Splitheap}
|
{$endif Splitheap}
|
||||||
|
|
||||||
Message1(parser_u_parsing_implementation,current_module.modulename^);
|
if has_impl then
|
||||||
if current_module.in_interface then
|
begin
|
||||||
internalerror(200212285);
|
Message1(parser_u_parsing_implementation,current_module.modulename^);
|
||||||
|
if current_module.in_interface then
|
||||||
|
internalerror(200212285);
|
||||||
|
|
||||||
{ Compile the unit }
|
{ Compile the unit }
|
||||||
pd:=create_main_proc(make_mangledname('',current_module.localsymtable,'init'),potype_unitinit,st);
|
pd:=create_main_proc(make_mangledname('',current_module.localsymtable,'init'),potype_unitinit,st);
|
||||||
pd.aliasnames.insert(make_mangledname('INIT$',current_module.localsymtable,''));
|
pd.aliasnames.insert(make_mangledname('INIT$',current_module.localsymtable,''));
|
||||||
tcgprocinfo(current_procinfo).parse_body;
|
tcgprocinfo(current_procinfo).parse_body;
|
||||||
tcgprocinfo(current_procinfo).generate_code;
|
tcgprocinfo(current_procinfo).generate_code;
|
||||||
tcgprocinfo(current_procinfo).resetprocdef;
|
tcgprocinfo(current_procinfo).resetprocdef;
|
||||||
release_main_proc(pd);
|
release_main_proc(pd);
|
||||||
|
end;
|
||||||
|
|
||||||
{ if the unit contains ansi/widestrings, initialization and
|
{ if the unit contains ansi/widestrings, initialization and
|
||||||
finalization code must be forced }
|
finalization code must be forced }
|
||||||
@ -1084,7 +1099,7 @@ implementation
|
|||||||
if force_init_final and ((current_module.flags and uf_init)=0) then
|
if force_init_final and ((current_module.flags and uf_init)=0) then
|
||||||
gen_implicit_initfinal(uf_init,st);
|
gen_implicit_initfinal(uf_init,st);
|
||||||
{ finalize? }
|
{ finalize? }
|
||||||
if token=_FINALIZATION then
|
if has_impl and (token=_FINALIZATION) then
|
||||||
begin
|
begin
|
||||||
{ set module options }
|
{ set module options }
|
||||||
current_module.flags:=current_module.flags or uf_finalize;
|
current_module.flags:=current_module.flags or uf_finalize;
|
||||||
@ -1458,7 +1473,11 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.149 2004-05-02 17:26:19 peter
|
Revision 1.150 2004-05-03 09:55:27 olle
|
||||||
|
+ enable omitting of IMPLEMENTATION for mode mac
|
||||||
|
+ added macro FPC_MAC for mode mac
|
||||||
|
|
||||||
|
Revision 1.149 2004/05/02 17:26:19 peter
|
||||||
* fix stabs for globals
|
* fix stabs for globals
|
||||||
|
|
||||||
Revision 1.148 2004/03/24 20:24:25 hajny
|
Revision 1.148 2004/03/24 20:24:25 hajny
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user