* cleaning up sets for exports behaviour

+ allow exports from units

git-svn-id: trunk@1535 -
This commit is contained in:
florian 2005-10-19 19:06:45 +00:00
parent cf3c9bdcad
commit e1b34a9e7b
6 changed files with 45 additions and 16 deletions

1
.gitattributes vendored
View File

@ -6350,6 +6350,7 @@ tests/webtbs/uw2040.pp svneol=native#text/plain
tests/webtbs/uw2266a.inc svneol=native#text/plain tests/webtbs/uw2266a.inc svneol=native#text/plain
tests/webtbs/uw2266b.pas svneol=native#text/plain tests/webtbs/uw2266b.pas svneol=native#text/plain
tests/webtbs/uw2269.inc svneol=native#text/plain tests/webtbs/uw2269.inc svneol=native#text/plain
tests/webtbs/uw2364.pp svneol=native#text/plain
tests/webtbs/uw2706a.pp svneol=native#text/plain tests/webtbs/uw2706a.pp svneol=native#text/plain
tests/webtbs/uw2706b.pp svneol=native#text/plain tests/webtbs/uw2706b.pp svneol=native#text/plain
tests/webtbs/uw2731.pp svneol=native#text/plain tests/webtbs/uw2731.pp svneol=native#text/plain

View File

@ -900,6 +900,9 @@ implementation
dispose(s1); dispose(s1);
end; end;
if (target_info.system in system_unit_program_exports) then
exportlib.preparelib(current_module.realmodulename^);
consume(_ID); consume(_ID);
consume(_SEMICOLON); consume(_SEMICOLON);
consume(_INTERFACE); consume(_INTERFACE);
@ -1311,7 +1314,7 @@ implementation
stringdispose(current_module.realmodulename); stringdispose(current_module.realmodulename);
current_module.modulename:=stringdup(pattern); current_module.modulename:=stringdup(pattern);
current_module.realmodulename:=stringdup(orgpattern); current_module.realmodulename:=stringdup(orgpattern);
if (target_info.system in [system_i386_WIN32,system_i386_wdosx]) then if (target_info.system in system_unit_program_exports) then
exportlib.preparelib(orgpattern); exportlib.preparelib(orgpattern);
consume(_ID); consume(_ID);
if token=_LKLAMMER then if token=_LKLAMMER then
@ -1324,7 +1327,7 @@ implementation
end; end;
consume(_SEMICOLON); consume(_SEMICOLON);
end end
else if (target_info.system in [system_i386_WIN32,system_i386_wdosx]) then else if (target_info.system in system_unit_program_exports) then
exportlib.preparelib(current_module.realmodulename^); exportlib.preparelib(current_module.realmodulename^);
{ global switches are read, so further changes aren't allowed } { global switches are read, so further changes aren't allowed }

View File

@ -1384,21 +1384,13 @@ implementation
_EXPORTS: _EXPORTS:
begin begin
if not(assigned(current_procinfo.procdef.localst)) or if not(assigned(current_procinfo.procdef.localst)) or
(current_procinfo.procdef.localst.symtablelevel>main_program_level) or (current_procinfo.procdef.localst.symtablelevel>main_program_level) then
(current_module.is_unit) then
begin begin
Message(parser_e_syntax_error); Message(parser_e_syntax_error);
consume_all_until(_SEMICOLON); consume_all_until(_SEMICOLON);
end end
else if islibrary or else if islibrary or
(target_info.system in [ (target_info.system in system_unit_program_exports) then
system_i386_win32,
system_i386_wdosx,
system_i386_Netware,
system_i386_netwlibc,
system_arm_wince,
system_x86_64_win64,
system_ia64_win64]+system_linux) then
read_exports read_exports
else else
begin begin

View File

@ -320,15 +320,24 @@ interface
system_any = system_none; system_any = system_none;
system_wince : set of tsystem = [system_arm_wince,system_i386_wince]; system_wince : set of tsystem = [system_arm_wince,system_i386_wince];
system_linux : set of tsystem = [system_i386_linux,system_x86_64_linux,system_powerpc_linux, system_linux = [system_i386_linux,system_x86_64_linux,system_powerpc_linux,
system_arm_linux,system_sparc_linux,system_alpha_linux,system_m68k_linux, system_arm_linux,system_sparc_linux,system_alpha_linux,system_m68k_linux,
system_x86_6432_linux]; system_x86_6432_linux];
{ all real windows systems, no cripple ones like wince, wdosx et. al. } { all real windows systems, no cripple ones like wince, wdosx et. al. }
system_windows : set of tsystem = [system_i386_win32,system_x86_64_win64,system_ia64_win64]; system_windows : set of tsystem = [system_i386_win32,system_x86_64_win64,system_ia64_win64];
{ all windows systems } { all windows systems }
system_all_windows : set of tsystem = [system_i386_win32,system_x86_64_win64,system_ia64_win64, system_all_windows : set of tsystem = [system_i386_win32,system_x86_64_win64,system_ia64_win64,
system_arm_wince,system_i386_wince]; system_arm_wince,system_i386_wince];
{ all systems supporting exports from programs or units }
system_unit_program_exports : set of tsystem = [system_i386_win32,
system_i386_wdosx,
system_i386_Netware,
system_i386_netwlibc,
system_arm_wince,
system_x86_64_win64,
system_ia64_win64]+system_linux;
cpu2str : array[TSystemCpu] of string = cpu2str : array[TSystemCpu] of string =
('','i386','m68k','alpha','powerpc','sparc','vm','ia64','x86_64', ('','i386','m68k','alpha','powerpc','sparc','vm','ia64','x86_64',
'mips','arm', 'powerpc64'); 'mips','arm', 'powerpc64');

View File

@ -561,7 +561,6 @@ implementation
end; end;
procedure texportlibwin32.exportvar(hp : texported_item); procedure texportlibwin32.exportvar(hp : texported_item);
begin begin
{ same code used !! PM } { same code used !! PM }

25
tests/webtbs/uw2364.pp Normal file
View File

@ -0,0 +1,25 @@
{ %TARGET=win64,wince,win32,linux }
{ Source provided for Free Pascal Bug Report 2364 }
{ Submitted by "Maarten Bekers" on 2003-02-08 }
{ e-mail: fpc-bugs@elebbs.com }
unit tw2364;
interface
type blah = function: integer;
function iee: integer;
var blah2: blah;
implementation
function iee: integer;
begin
end;
exports
iee;
end.