On 10 May 2003 at 12:22, I wrote:
[...]
I have another problem. This code used to compile:
unit attrbug_2; interface uses GPC; FUNCTION DirectoryExists ( CONST DirName : String ) : Boolean; attribute (name = '_p_DirectoryExists'); external; FUNCTION FileSearch ( CONST FileName, DirList : String ) : TString; attribute (name = '_p_FSearch'); external; implementation end.
Now, it dies with this error: "attributes in forward declared routines are not allowed". If "external" is removed, then you get an error like "unresolved forward declaration `FileSearch'".
This code is taken from the Sysutils unit, which exports some functions that already exist in the GPC unit. In older times, you just asmnamed them. In the penultimate snapshot, that was changed to the above. Now, it doesn't work. I need this to work (or at least I need to have a way to reexport routines from other units). This is reminiscent of the earlier discussions on unit propagation. I am not sure how that discussion was resolved.
Unfortunately, this problem is not only related to unit propagation. I have just tried to compile the Windows unit (that exports thousands of winapi routines, interfacing to the Mingw winapi libraries), and two of those routines are now rejected with the "attributes in forward declared routines are not allowed" error. There is no reason for those two routines to be singled out, and there is no USES problem here.
Best regards, The Chief -------- Prof. Abimbola A. Olowofoyeku (The African Chief) web: http://www.bigfoot.com/~african_chief/