Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2011-12

Makeskel errors on Windows

18 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Hans-Peter Diettrich

Makeskel expects another(?) semicolon after win\wininc\func.inc:

function GetRandomRgn(aHDC: HDC; aHRGN: HRGN; iNum: WINT): WINT;
stdcall; external 'gdi32';
function ...

Perhaps it cannot parse the "external" directive?

FPDoc seems to suffer from the same problem, it creates an all-empty description for windows.pp.

Workaround: exclude "func.inc" from the include file list in windows.pp:

{$IFNDEF fpdocsystem}
   {$i func.inc}
{$ENDIF}

Then windows.pp can be added to the rtl project, and is documented by fpdoc. No content so far, of course.

I also could not find an option to make the Makefile use a different OSTARGET - it always seems to use the current system settings. Even if some cross-platform information may be desireable in the documentation, some essentially platform-dependent units should be documented in the current platform variation, e.g. rtl/win32/system.pp instead of rtl/linux/system.pp, winsocks instead of or in addition to the linux sockets. For units for other targets (dos...) the compiler options should reflect the proper compiler options (-d<target>, -Fi), else the generated documentation may be quite useless.

For platform-specific units with a common interface (system, classes...) the XML files can either reflect all platform variations, or the descriptions can be separated into common documentation (*.xml) and platform specific extensions (*<target>.xml), so that entries are not inadvertently removed, when they do not apply to the platform of an documentation writer.

Regardless of whether we want to provide all-in-one documentation, or platform specific documentation, the generation of the documents deserves some more thoughts. The current Linux (+dos+...-windows) documentation is not really helpful to Windows users.

DoDi

Reply by email

Michael Van Canneyt
to Hans-Peter Diettrich
Hans-Peter Diettrich wrote 10 lines
Makeskel expects another(?) semicolon after win\wininc\func.inc: function GetRandomRgn(aHDC: HDC; aHRGN: HRGN; iNum: WINT): WINT; stdcall; external 'gdi32'; function ... Perhaps it cannot parse the "external" directive? FPDoc seems to suffer from the same problem, it creates an all-empty description for windows.pp.

I will look into this.

Show quoted text 9 lines
Workaround: exclude "func.inc" from the include file list in windows.pp: {$IFNDEF fpdocsystem} {$i func.inc} {$ENDIF} Then windows.pp can be added to the rtl project, and is documented by fpdoc. No content so far, of course.

And as long as it is not 100% documented, it will not be added. In other words, the windows unit will probably never make it in the official docs.

I do not think it makes any sense to do so anyway. The windows API is best documented on MSDN; You'd be far better off finding a system that links to MSDN as soon as F1 is pressed on a windows unit identifier. Empty documentation is of no use to anyone.

Michael.

Reply by email

Marco van de Voort
to Michael Van Canneyt

In our previous episode, Michael Van Canneyt said:

Show quoted text 8 lines
And as long as it is not 100% documented, it will not be added. In other words, the windows unit will probably never make it in the official docs. I do not think it makes any sense to do so anyway. The windows API is best documented on MSDN; You'd be far better off finding a system that links to MSDN as soon as F1 is pressed on a windows unit identifier. Empty documentation is of no use to anyone.

I must admit that before I mastered C enough to read the declarations on MSDN, mid/end nineties I used the win32kb documentation of Delphi quite a lot.

Reply by email

Michael Van Canneyt
to Marco van de Voort
Marco van de Voort wrote 13 lines
In our previous episode, Michael Van Canneyt said: > > And as long as it is not 100% documented, it will not be added. > In other words, the windows unit will probably never make it in the official docs. > > I do not think it makes any sense to do so anyway. The windows API is best > documented on MSDN; You'd be far better off finding a system that links to > MSDN as soon as F1 is pressed on a windows unit identifier. > Empty documentation is of no use to anyone. I must admit that before I mastered C enough to read the declarations on MSDN, mid/end nineties I used the win32kb documentation of Delphi quite a lot.

Yes, but at least it was filled with actual documentation.

Michael.

Reply by email

Hans-Peter Diettrich
to Michael Van Canneyt: I will look into this. And as long as it is not 100% documented, it will not be added. In…
And as long as it is not 100% documented, it will not be added. In other words, the windows unit will probably never make it in the official docs.

At least TSystemTime is declared there, used in GetLocalTime (Win32 platform). Dunno about other types or constants, used in other Win32 RTL and FCL units (winsocks...).

I do not think it makes any sense to do so anyway. The windows API is best documented on MSDN; You'd be far better off finding a system that links to MSDN as soon as F1 is pressed on a windows unit identifier. Empty documentation is of no use to anyone.

Type declarations and constants are useful even without detailed documentation. When I started to document the LCL, I found many (Delphi) functions based on the WinAPI, so that some documentation is required anyhow.

I agree that a description of the full WinAPI can be omitted from the general RTL/FCL documentation, but the used (linked) items should be documented.

DoDi

Reply by email

Sven Barth
to Hans-Peter Diettrich: Makeskel expects another(?) semicolon after win\wininc\func.inc: function…
Hans-Peter Diettrich wrote 9 lines
I also could not find an option to make the Makefile use a different OSTARGET - it always seems to use the current system settings. Even if some cross-platform information may be desireable in the documentation, some essentially platform-dependent units should be documented in the current platform variation, e.g. rtl/win32/system.pp instead of rtl/linux/system.pp, winsocks instead of or in addition to the linux sockets. For units for other targets (dos...) the compiler options should reflect the proper compiler options (-d<target>, -Fi), else the generated documentation may be quite useless.

Just as a sidenote: unit "Dos" is platform independant (every (full) target has one and the common parts reside in dos.inc and dosh.inc in %fpcdir%\rtl\inc)

Regards,
Sven

Reply by email

Hans-Peter Diettrich
to Sven Barth
Just as a sidenote: unit "Dos" is platform independant (every (full) target has one and the common parts reside in dos.inc and dosh.inc in %fpcdir%\rtl\inc)

Ah, thanks.

Then Go32v2 is the (MS?)Dos platform?

Looks now as if platforms reside in the rtl subdirectories, except "common", "inc" and "objpas"?

DoDi

Reply by email

Michael Van Canneyt
to Hans-Peter Diettrich: At least TSystemTime is declared there, used in GetLocalTime (Win32 platform). Dunno…
Hans-Peter Diettrich wrote 9 lines
Michael Van Canneyt schrieb: > And as long as it is not 100% documented, it will not be added. > In other words, the windows unit will probably never make it in the > official docs. At least TSystemTime is declared there, used in GetLocalTime (Win32 platform). Dunno about other types or constants, used in other Win32 RTL and FCL units (winsocks...).

If you'd check carefully TSystemTime is declared and documented in sysutils.

If you build for Win32, then it's not documented, because on windows, the windows unit definition is used. It's one of the reasons why I explicitly build for Linux: the RTL contains many structures that have their roots in the win32 API. On other platforms, these structures are defined explicitly outside the windows unit, and hence, documented.

So it seems to me you created an artificial problem.

Show quoted text 8 lines
> I do not think it makes any sense to do so anyway. The windows API is best > documented on MSDN; You'd be far better off finding a system that links to > MSDN as soon as F1 is pressed on a windows unit identifier. Empty > documentation is of no use to anyone. Type declarations and constants are useful even without detailed documentation.

Nonsense.
ctrl-click in the IDE will get you more info by actually jumping to the declaration.

When I started to document the LCL, I found many (Delphi) functions based on the WinAPI, so that some documentation is required anyhow.

Once more, I think you should let the WinAPI be documented by MSDN. No need to drag in things that are better documented somewhere else. But if you want to spend your time on it, who am I to stop you ?

If you finish documenting actual FPC/Lazarus code, then I think your mission will have succeeded.

Michael.

Reply by email

Michael Van Canneyt
to Hans-Peter Diettrich: Ah, thanks. Then Go32v2 is the (MS?)Dos platform? Looks now as if platforms reside in the…
Hans-Peter Diettrich wrote 9 lines
Sven Barth schrieb: > Just as a sidenote: unit "Dos" is platform independant (every (full) target > has one and the common parts reside in dos.inc and dosh.inc in > %fpcdir%\rtl\inc) Ah, thanks. Then Go32v2 is the (MS?)Dos platform?

Yes.

Looks now as if platforms reside in the rtl subdirectories, except "common", "inc" and "objpas"?

This is mostly correct.

Michael.

Reply by email

Tomas Hajny
to Hans-Peter Diettrich: Ah, thanks. Then Go32v2 is the (MS?)Dos platform? Looks now as if platforms reside in the…
Hans-Peter Diettrich wrote 9 lines
Sven Barth schrieb: > Just as a sidenote: unit "Dos" is platform independant (every (full) > target has one and the common parts reside in dos.inc and dosh.inc in > %fpcdir%\rtl\inc) Ah, thanks. Then Go32v2 is the (MS?)Dos platform?

The main (and only fully working) one, yes (Watcom may still be compilable as an alternative but lacking in features a lot; EMX also provides an option of running under DOS with extender).

Looks now as if platforms reside in the rtl subdirectories, except "common", "inc" and "objpas"?

Right, just add subdirectories created to support a group of platforms (e.g. "unix" and "win" which are not specific platforms but rather platform groups).

Tomas

Reply by email

Sven Barth
to Tomas Hajny
Tomas Hajny wrote 6 lines
> Looks now as if platforms reside in the rtl subdirectories, except > "common", "inc" and "objpas"? Right, just add subdirectories created to support a group of platforms (e.g. "unix" and "win" which are not specific platforms but rather platform groups).

And of course the CPU directories ("i386", "x86_64", "m68k", "powerpc"...). Also the "ucmaps" directory holds only code page tables.

Regards,
Sven

Reply by email

Hans-Peter Diettrich
to Michael Van Canneyt: If you'd check carefully TSystemTime is declared and documented in sysutils. If you build…
Show quoted text 6 lines
> At least TSystemTime is declared there, used in GetLocalTime (Win32 > platform). Dunno about other types or constants, used in other Win32 > RTL and FCL units (winsocks...). If you'd check carefully TSystemTime is declared and documented in sysutils.

Not in the windows version.

Show quoted text 8 lines
If you build for Win32, then it's not documented, because on windows, the windows unit definition is used. It's one of the reasons why I explicitly build for Linux: the RTL contains many structures that have their roots in the win32 API. On other platforms, these structures are defined explicitly outside the windows unit, and hence, documented. So it seems to me you created an artificial problem.

Why me? It's fpdoc who chooses to ignore the description :-(

I only revealed several inconsistencies with the generation of the RTL documentation on a Windows system. Currently it looks as if it is a bad idea to generate the documentation in a platform-dependent the mess started with missing include files, whereupon the platform specific include directories were added to the compiler options. Now guess what declarations fpdoc finds in e.g. input="../rtl/unix/sysutils.pp -Fi../rtl/objpas/sysutils -Fi../rtl/inc -Fi../rtl/win -Fi../rtl/win32 -Fi../rtl/unix -Fi../rtl/linux"

Also note that
--input="-dfpdocsystem -dHASGETHEAPSTATUS -dSUPPORT_DOUBLE ../rtl/win32/system.pp -Fi../rtl/win32 -Fi../rtl/unix -Fi../rtl/inc -Fi../rtl/i386 -dCPU32 -dHASVARIANT -dFPC_HAS_TYPE_EXTENDED -dHASWIDECHAR -Fi../rtl/win -Fi../rtl/win32 -Fi../rtl/unix -Fi../rtl/linux"

explicitly selects /win32/system.pp, not the (expected) /unix/system.pp

When I tried to continue the new way, by replacing more inputs by their Windows specific versions, more problems popped up.

The addition of the win and win32 includes IMO was not a good decision, instead the parser should use the Linux target (as you assume) instead of the actual platform.

To reduce further discussion, I'd suggest that you provide the fpdoc project(s) that create identical output on all platforms. Then we can concentrate on the remaining missing links, like "Power", and delegate the resolution of problems resulting from modified projects to the creators/maintainers of these projects.

Show quoted text 5 lines
> Type declarations and constants are useful even without detailed > documentation. Nonsense. ctrl-click in the IDE will get you more info by actually jumping to the declaration.

Right, but what's the use of *additional* documentation at all?

It's confusing, when the documentation differs from the declarations, and when no documentation is shown at all, because fpdoc doesn't find the declarations in the platform specific units, this also is not a pleasant situation :-(

Show quoted text 6 lines
> When I started to document the LCL, I found many (Delphi) functions > based on the WinAPI, so that some documentation is required anyhow. Once more, I think you should let the WinAPI be documented by MSDN. No need to drag in things that are better documented somewhere else. But if you want to spend your time on it, who am I to stop you ?

It's even worse: when the RTL or LCL tries to implement the used WinAPI functions in other environments, the differences have to be documented as well. Many MSDN description details are not applicable outside Windows :-(

If you finish documenting actual FPC/Lazarus code, then I think your mission will have succeeded.

This could be understood as "hang on the LCL documentation for the rest of your life, and don't bother the FPC developers any more" ;-)

DoDi

P.S.: In case my preceding attachment was removed, I add it again as text file.

Reply by email

Michael Van Canneyt
to Hans-Peter Diettrich
Hans-Peter Diettrich wrote 9 lines
I only revealed several inconsistencies with the generation of the RTL documentation on a Windows system. Currently it looks as if it is a bad idea to generate the documentation in a platform-dependent it seems. The addition of the win and win32 includes IMO was not a good decision, instead the parser should use the Linux target (as you assume) instead of the actual platform.

I don't think the parser is the problem.

To reduce further discussion, I'd suggest that you provide the fpdoc project(s) that create identical output on all platforms.

To my knowledge, there is no such project.

Show quoted text 7 lines
Then we can concentrate on the remaining missing links, like "Power", and delegate the resolution of problems resulting from modified projects to the creators/maintainers of these projects. This could be understood as "hang on the LCL documentation for the rest of your life, and don't bother the FPC developers any more" ;-)

No, I meant:

Documenting is a huge task. I suggest you stick to LCL routines without getting lost in things like the windows API. Documenting the LCL is a monumental task in itself, and whether or not a certain windows specific structure is documented is in my opinion not so relevant. So, I suggest you stick to the various components available in the LCL, it will be of much more aid to people than the discussions we are having now. At least that is my belief, feel free to disagree.

If there are any technical problems with FPDoc, then I will try to solve them. I am working on support for the new compiler features, such as nested types and type helpers and such. They are needed to parse the classes unit in trunk.

Michael.

Reply by email

Hans-Peter Diettrich
to Michael Van Canneyt
Show quoted text 5 lines
> The addition of the win and win32 includes IMO was not a good decision, > instead the parser should use the Linux target (as you assume) instead > of the actual platform. I don't think the parser is the problem.

The problem are the (platform dependent) arguments, passed to the parser.

> To reduce further discussion, I'd suggest that you provide the fpdoc > project(s) that create identical output on all platforms. To my knowledge, there is no such project.

...and none will be unless somebody creates it :-(

Unlike a Makefile, an fpdoc project (file) should behave the same on every machine.

Show quoted text 5 lines
If there are any technical problems with FPDoc, then I will try to solve them. I am working on support for the new compiler features, such as nested types and type helpers and such. They are needed to parse the classes unit in trunk.

The LCL problem is not related to new syntax, all units parse without errors. But document creation crashes on screen.inc

   FontEnumProc = function (var ELogFont:TEnumLogFont; var
Metric:TNewTextMetric;
     FontType:longint; Data:LParam):longint; extdecl;

where "extdecl" is a macro:

{$ifdef WinCE}
   {$define extdecl := cdecl}
{$else}
   {$define extdecl := stdcall}
{$endif}

Should I create an bug report?

DoDi

Reply by email

Michael Van Canneyt
to Hans-Peter Diettrich
Hans-Peter Diettrich wrote 16 lines
Michael Van Canneyt schrieb: >> The addition of the win and win32 includes IMO was not a good decision, >> instead the parser should use the Linux target (as you assume) instead >> of the actual platform. > > I don't think the parser is the problem. The problem are the (platform dependent) arguments, passed to the parser. >> To reduce further discussion, I'd suggest that you provide the fpdoc >> project(s) that create identical output on all platforms. > > To my knowledge, there is no such project. ...and none will be unless somebody creates it :-(

That is a tautology.

Unlike a Makefile, an fpdoc project (file) should behave the same on every machine.

Good luck :)

Show quoted text 13 lines
> If there are any technical problems with FPDoc, then I will try to solve > them. > I am working on support for the new compiler features, such as nested types > and type helpers and such. They are needed to parse the classes unit in > trunk. The LCL problem is not related to new syntax, all units parse without errors. But document creation crashes on screen.inc FontEnumProc = function (var ELogFont:TEnumLogFont; var Metric:TNewTextMetric; FontType:longint; Data:LParam):longint; extdecl;

What exactly goes wrong ?
It parses it just fine in a test environment, I just tested ?

Michael.

Reply by email

Hans-Peter Diettrich
to Michael Van Canneyt
Show quoted text 9 lines
> The LCL problem is not related to new syntax, all units parse without > errors. But document creation crashes on screen.inc > > FontEnumProc = function (var ELogFont:TEnumLogFont; var > Metric:TNewTextMetric; > FontType:longint; Data:LParam):longint; extdecl; What exactly goes wrong ? It parses it just fine in a test environment, I just tested ?

Yes, parsing works, but when I create the docs I get:

//my added debug messages
Now creating \AllDocs\lcl\lcltype\fontenumproc.html Error Element.Args FontEnumProc

exception at 00420365:
Access violation.

D:\repos\lazarusTrunk\docs>

Even with rev. 19802 :-(

DoDi

Reply by email