Angelo FUMAGALLI wrote:
Hello,
to solve this internal error we passed to the last gpc version (gpc version 20050331, based on gcc-3.4.3) but unfortunately we got another unexpected problem related to "global" procedures names that have been changed respect the gpc 20041218. In fact the gpc 20050331 change the internal name of "global" procedures adding a variable prefix as, for exam?ple, "_p_Mx_modulename_Sy_procedurename" instead the original "procedurename". For us this change loads big problem because, our pascal modules come from VAX/VMS and are structured to be exported as object library containing thousand of modules and some environment modules to be used as interface by application pascal modules. We have a lot of applicatons and the related pascal modules cannot use internal library modules as interface because don't know them but know only some (2 or 3) "library interface modules". So, porting our pascal modules under gpc the choise was to maintaining the original modules structures in terms of files, so we create the related gpc modules containing the proper interface to resolve the references to the library procedures, types and variables.
gpc allows reexport, so you can easily create "library interface modules" just using official methods. Namely,
module lib_int; export lib_int = (fun1, fun2); import lib1; lib2; end; end .
gives you interface to the library consisting of two modules: `lib1' and `lib2' (assuming that `lib1' implements function `fun1' and `lib2' implements function `fun2'). This form is quite flexible, you can specify which functions (types, constants, variables) you want to export and you can re-name them if you wish.
There is also a shortcut, if you write:
module lib_int2; export lib_int2 = all; import lib1; lib2; end; end .
and compile `lib_int2' using `-fpropagate-units' option, then `lib_int2' will automatically re-export all functions, types, constants and variables defined in `lib1' and `lib2'.
The first method requires the interface module to be EP module. The shortcut also works if the interface module actually is a unit.
--- Waldek Hebisch hebisch@math.uni.wroc.pl