Pelles C forum

Pelles C => Bug reports => Topic started by: Robert on June 05, 2018, 08:46:57 AM

Title: Version 9.00 RC1 error #2001
Post by: Robert on June 05, 2018, 08:46:57 AM
This legacy code from John Walker's MoonTool

Code: [Select]
extern BOOL FAR PASCAL About(HWND, UINT, WPARAM, LPARAM);
extern BOOL FAR PASCAL SetJdate(HWND, UINT, WPARAM, LPARAM);
extern BOOL FAR PASCAL SetUtime(HWND, UINT, WPARAM, LPARAM);

compiled with Pelles C Version 8.00 but Version 9.00 RC1 throws these errors

Building MOONCALC.obj.
D:\Documents\Pelles C Projects\MoonTool\moontool.h(40): error #2001: Syntax error: expected ';' but found '__stdcall'.
D:\Documents\Pelles C Projects\MoonTool\moontool.h(40): warning #2099: Missing type specifier; assuming 'int'.
D:\Documents\Pelles C Projects\MoonTool\moontool.h(41): error #2001: Syntax error: expected ';' but found '__stdcall'.
D:\Documents\Pelles C Projects\MoonTool\moontool.h(41): warning #2099: Missing type specifier; assuming 'int'.
D:\Documents\Pelles C Projects\MoonTool\moontool.h(42): error #2001: Syntax error: expected ';' but found '__stdcall'.
D:\Documents\Pelles C Projects\MoonTool\moontool.h(42): warning #2099: Missing type specifier; assuming 'int'.
*** Error code: 1 ***
Done.

The MoonTool Project is attached.
Title: Re: Version 9.00 RC1 error #2001
Post by: Pelle on June 05, 2018, 06:22:07 PM
You need empty definitions for the preprocessor symbols FAR and far - for example "Project Options" -> "Compiler" Tab, "Define preprocessor symbols" field, add the names FAR and far.

I was kind of hoping this 16-bit Windows stuff was gone by now, some 20 years later, but apparently not. Oh well, I will add some FAR/far/NEAR/near definitions for the next upload.

Also, for now, comment out line 10 in MoonTool.rc: #include "moontool.h". This include adds nothing, but will trigger errors about bad compiler version for <time.h>, <stdio.h> etc. Such include files are meaningless for a resource script, but I should handle this better when they are. I will try to fix this for the next upload.