Prof A Olowofoyeku (The African Chief) wrote:
Well, as I said, I have done grep searches, and there are no repeated declarations involved. One example is: FUNCTION InterlockedIncrement ( VAR lpAddend : LongInt ) : LongInt; WINAPI ( 'InterlockedIncrement' ); It is not referred to in any other source file.
WINAPI thus defined: {$define Stdcall attribute(stdcall)} {$define WINAPI(X) external name X; Stdcall}
If you can't find it out, please send me some example code ...
It is not possible to reduce this to any simple example that shows the problem. A simple unit with the above declarations compiles okay. But in the winprocs.pas source, it gives the error. There is no reason why it should. If you want to have a go, perhaps you can download the latest winapi release from contrib/chief/ on the GPC server.
I see. The error was not actually about this function, but the previous one (which is in fact declared twice).
Since GPC needs to read past the terminating `;' of the declaration (in case there are more attributes), it is already at the beginning of the next line when giving the error, so the line number is misleading.
I'll try to fix this, but it might not be too easy. For now, just remember to look in the previous line (for many kinds of errors) ...
Frank