diff options
author | svenbarth <svenbarth@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2016-01-22 13:57:41 +0000 |
---|---|---|
committer | svenbarth <svenbarth@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2016-01-22 13:57:41 +0000 |
commit | 363254ddb6ca4ac6896da395838ebac34ee01e01 (patch) | |
tree | 134c5bcdb5af0a7db826f5b9a66e7b0b5ac5d9ea /compiler/export.pas | |
parent | 8b7d814a1c4d1db77efcf9457cba1aa284dca7a1 (diff) | |
download | fpc-363254ddb6ca4ac6896da395838ebac34ee01e01.tar.gz |
Merged revision(s) 28792 from branches/svenbarth/packages:
Provide a possibility to ignore duplicate symbols for exporting.
export.pas, texportlib:
+ new property "ignoreduplicates" with which duplicate symbols are ignored upon insertion
+ new method "duplicatesymbol" which checks "ignoreduplicates" and generates an error if it is False (this method needs to be used if a duplicate was detected)
expunix.pas, texportlibunix:
* exportprocedure: use "duplicatesymbol" instead of always generating an error
systems/t_beos.pas, texportlibbeos:
* exportprocedure: use "duplicatesymbol" instead of always generating an error
systems/t_haiku.pas, texportlibhaiku:
* exportprocedure: use "duplicatesymbol" instead of always generating an error
systems/t_nwl.pas, texportlibnetwlibc:
* exportprocedure: use "duplicatesymbol" instead of always generating an error
systems/t_nwm.pas, texportlibnetware:
* exportprocedure: use "duplicatesymbol" instead of always generating an error
systems/t_win.pas, texportlibwin:
* exportfromlist: use "duplicatesymbol" instead of always generating an error
........
git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@32974 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'compiler/export.pas')
-rw-r--r-- | compiler/export.pas | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/compiler/export.pas b/compiler/export.pas index f168c1e924..d3363b9119 100644 --- a/compiler/export.pas +++ b/compiler/export.pas @@ -53,9 +53,12 @@ type texportlib=class private notsupmsg : boolean; + fignoreduplicates : boolean; finitname, ffininame : string; procedure NotSupported; + protected + procedure duplicatesymbol(const s:string); public constructor Create;virtual; destructor Destroy;override; @@ -68,6 +71,7 @@ type property initname: string read finitname; property fininame: string read ffininame; + property ignoreduplicates : boolean read fignoreduplicates write fignoreduplicates; end; TExportLibClass=class of TExportLib; @@ -188,6 +192,7 @@ end; constructor texportlib.Create; begin notsupmsg:=false; + fignoreduplicates:=false; end; @@ -207,6 +212,15 @@ begin end; +procedure texportlib.duplicatesymbol(const s: string); +begin + { only generate an error if the caller is not aware that it could generate + duplicates (e.g. exporting from a package) } + if not ignoreduplicates then + Message1(parser_e_export_name_double,s); +end; + + procedure texportlib.preparelib(const s:string); begin NotSupported; |