Sign in Join

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

Mailing lists / fpc-devel / 2008-10

FPC_HAS_FEATURE_SUPPORT

12 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

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

Mattias Gaertner

Can someone explain the new FPC system layout?
I find out so far:

In rtl/inc/systemh.inc there is

{$ifndef FPC_HAS_FEATURE_SUPPORT}
...
{$define FPC_HAS_FEATURE_CLASSES}
...
{$ENDIF}

Because FPC 2.3.1 defines FPC_HAS_FEATURE_SUPPORT the above is never executed and therefore FPC_HAS_FEATURE_CLASSES is never defined. So for example TObject is never defined.

What defines FPC_HAS_FEATURE_CLASSES and the other features?

Mattias

Reply by email

Mattias Gaertner
to Mattias Gaertner
Show quoted text 16 lines
Can someone explain the new FPC system layout? I find out so far: In rtl/inc/systemh.inc there is {$ifndef FPC_HAS_FEATURE_SUPPORT} ... {$define FPC_HAS_FEATURE_CLASSES} ... {$ENDIF} Because FPC 2.3.1 defines FPC_HAS_FEATURE_SUPPORT the above is never executed and therefore FPC_HAS_FEATURE_CLASSES is never defined. So for example TObject is never defined. What defines FPC_HAS_FEATURE_CLASSES and the other features?

Is this work in progress, vacation or was the question too complicated?

Mattias

Reply by email

Michael Van Canneyt
to Mattias Gaertner
Mattias Gaertner wrote 21 lines
On Fri, 17 Oct 2008 19:03:43 +0200 Mattias Gaertner wrote: > Can someone explain the new FPC system layout? > I find out so far: > > In rtl/inc/systemh.inc there is > > {$ifndef FPC_HAS_FEATURE_SUPPORT} > ... > {$define FPC_HAS_FEATURE_CLASSES} > ... > {$ENDIF} > > Because FPC 2.3.1 defines FPC_HAS_FEATURE_SUPPORT the above is never > executed and therefore FPC_HAS_FEATURE_CLASSES is never defined. So > for example TObject is never defined. > > What defines FPC_HAS_FEATURE_CLASSES and the other features? Is this work in progress, vacation or was the question too complicated?

Florian is quite busy on his PhD.

I had a look myself.

As of version 2.3.1, the compiler by itself indicates all the various features it supports with FPC_HAS_FEATURE_XXX defines. Exactly which defines are defines depends on the compiler binary. For normal platforms, all features are enabled.

To indicate the use of this system, it defines FPC_HAS_FEATURE_SUPPORT.

To be able to compile the RTL with version 2.2.0, The systemh.inc checks for the presence of FPC_HAS_FEATURE_SUPPORT. If it is not defined then it assumes the version is below 2.3.0 and all the FPC_HAS_FEATURE_XXX confitionals are defined in the systemh.inc source.

To see the list of actual defines, you can do
ppc386 -vc test.pp
Macro defined: FPC_HAS_FEATURE_SUPPORT
Macro defined: CPU86
Macro defined: CPU87
Macro defined: CPU386
Macro defined: CPUI386
Macro defined: CPU32
Macro defined: FPC_HAS_TYPE_EXTENDED
Macro defined: FPC_HAS_TYPE_DOUBLE
Macro defined: FPC_HAS_TYPE_SINGLE
Macro defined: ENDIAN_LITTLE
Macro defined: FPC_LITTLE_ENDIAN
Macro defined: FPC_ABI_DEFAULT
Macro defined: CPUPENTIUM
Macro defined: FPUX87
Macro defined: FPC_LINK_STATIC
Macro FPC_VERSION set to 2
Macro FPC_RELEASE set to 3
Macro FPC_PATCH set to 1
Macro defined: FPC_HAS_FEATURE_HEAP
Macro defined: FPC_HAS_FEATURE_INITFINAL
Macro defined: FPC_HAS_FEATURE_RTTI
Macro defined: FPC_HAS_FEATURE_CLASSES
Macro defined: FPC_HAS_FEATURE_EXCEPTIONS
Macro defined: FPC_HAS_FEATURE_EXITCODE
Macro defined: FPC_HAS_FEATURE_ANSISTRINGS
Macro defined: FPC_HAS_FEATURE_WIDESTRINGS
Macro defined: FPC_HAS_FEATURE_TEXTIO
Macro defined: FPC_HAS_FEATURE_CONSOLEIO
Macro defined: FPC_HAS_FEATURE_FILEIO
Macro defined: FPC_HAS_FEATURE_RANDOM
Macro defined: FPC_HAS_FEATURE_VARIANTS
Macro defined: FPC_HAS_FEATURE_OBJECTS
Macro defined: FPC_HAS_FEATURE_DYNARRAYS
Macro defined: FPC_HAS_FEATURE_THREADING
Macro defined: FPC_HAS_FEATURE_COMMANDARGS
Macro defined: FPC_HAS_FEATURE_PROCESSES
Macro defined: FPC_HAS_FEATURE_STACKCHECK
Macro defined: FPC_HAS_FEATURE_DYNLIBS

For lazarus this means that it should either
- Not define FPC_HAS_FEATURE_SUPPORT
- Or define all FPC_HAS_FEATURE_XXX constants.
- Or maybe even check the compiler binary using the above method...

Michael.

Reply by email

Peter Vreman
Show quoted text 16 lines
As of version 2.3.1, the compiler by itself indicates all the various features it supports with FPC_HAS_FEATURE_XXX defines. Exactly which defines are defines depends on the compiler binary. For normal platforms, all features are enabled. To indicate the use of this system, it defines FPC_HAS_FEATURE_SUPPORT. To be able to compile the RTL with version 2.2.0, The systemh.inc checks for the presence of FPC_HAS_FEATURE_SUPPORT. If it is not defined then it assumes the version is below 2.3.0 and all the FPC_HAS_FEATURE_XXX confitionals are defined in the systemh.inc source. For lazarus this means that it should either - Not define FPC_HAS_FEATURE_SUPPORT - Or define all FPC_HAS_FEATURE_XXX constants. - Or maybe even check the compiler binary using the above method...

The best solution is using the PPUs instead of sources.

Peter

Reply by email

Mattias Gaertner
to Peter Vreman
Show quoted text 20 lines
> As of version 2.3.1, the compiler by itself indicates all the > various features it supports with FPC_HAS_FEATURE_XXX defines. > Exactly which defines are defines depends on the compiler binary. > For normal platforms, all features are enabled. > > To indicate the use of this system, it defines > FPC_HAS_FEATURE_SUPPORT. > > To be able to compile the RTL with version 2.2.0, The systemh.inc > checks for the presence of FPC_HAS_FEATURE_SUPPORT. If it is not > defined then it assumes the version is below 2.3.0 and all the > FPC_HAS_FEATURE_XXX confitionals are defined in the systemh.inc > source. > > For lazarus this means that it should either > - Not define FPC_HAS_FEATURE_SUPPORT > - Or define all FPC_HAS_FEATURE_XXX constants. > - Or maybe even check the compiler binary using the above method... The best solution is using the PPUs instead of sources.

Using which PPU reader?

Mattias

Reply by email

Peter Vreman
Show quoted text 25 lines
On Wed, 22 Oct 2008 10:32:36 +0200 (CEST) "Peter Vreman" wrote: > > As of version 2.3.1, the compiler by itself indicates all the > > various features it supports with FPC_HAS_FEATURE_XXX defines. > > Exactly which defines are defines depends on the compiler binary. > > For normal platforms, all features are enabled. > > > > To indicate the use of this system, it defines > > FPC_HAS_FEATURE_SUPPORT. > > > > To be able to compile the RTL with version 2.2.0, The systemh.inc > > checks for the presence of FPC_HAS_FEATURE_SUPPORT. If it is not > > defined then it assumes the version is below 2.3.0 and all the > > FPC_HAS_FEATURE_XXX confitionals are defined in the systemh.inc > > source. > > > > For lazarus this means that it should either > > - Not define FPC_HAS_FEATURE_SUPPORT > > - Or define all FPC_HAS_FEATURE_XXX constants. > > - Or maybe even check the compiler binary using the above method... > > The best solution is using the PPUs instead of sources. Using which PPU reader?

See the mail thread in june 2008 with a proposal to create a fcl-ppu package independent of the compiler.

http://www.hu.freepascal.org/lists/fpc-pascal/2008-June/017744.html

Peter

Reply by email

Mattias Gaertner
to Peter Vreman
Show quoted text 31 lines
> On Wed, 22 Oct 2008 10:32:36 +0200 (CEST) > "Peter Vreman" wrote: > >> > As of version 2.3.1, the compiler by itself indicates all the >> > various features it supports with FPC_HAS_FEATURE_XXX defines. >> > Exactly which defines are defines depends on the compiler binary. >> > For normal platforms, all features are enabled. >> > >> > To indicate the use of this system, it defines >> > FPC_HAS_FEATURE_SUPPORT. >> > >> > To be able to compile the RTL with version 2.2.0, The systemh.inc >> > checks for the presence of FPC_HAS_FEATURE_SUPPORT. If it is not >> > defined then it assumes the version is below 2.3.0 and all the >> > FPC_HAS_FEATURE_XXX confitionals are defined in the systemh.inc >> > source. >> > >> > For lazarus this means that it should either >> > - Not define FPC_HAS_FEATURE_SUPPORT >> > - Or define all FPC_HAS_FEATURE_XXX constants. >> > - Or maybe even check the compiler binary using the above >> > method... >> >> The best solution is using the PPUs instead of sources. > > Using which PPU reader? See the mail thread in june 2008 with a proposal to create a fcl-ppu package independent of the compiler. http://www.hu.freepascal.org/lists/fpc-pascal/2008-June/017744.html

I started a platform independent ppu reader in the codetools. Writing a simple parser is easy, writing a ppu find declaration is a lot of work and does not solve all problems. So this is a good solution and for some cases the best solution, but it is a long term solution and not available in the foreseeable future.

Mattias

Mattias

Reply by email

Michael Van Canneyt
to Mattias Gaertner
Mattias Gaertner wrote 40 lines
On Thu, 23 Oct 2008 08:53:27 +0200 (CEST) "Peter Vreman" wrote: > > On Wed, 22 Oct 2008 10:32:36 +0200 (CEST) > > "Peter Vreman" wrote: > > > >> > As of version 2.3.1, the compiler by itself indicates all the > >> > various features it supports with FPC_HAS_FEATURE_XXX defines. > >> > Exactly which defines are defines depends on the compiler binary. > >> > For normal platforms, all features are enabled. > >> > > >> > To indicate the use of this system, it defines > >> > FPC_HAS_FEATURE_SUPPORT. > >> > > >> > To be able to compile the RTL with version 2.2.0, The systemh.inc > >> > checks for the presence of FPC_HAS_FEATURE_SUPPORT. If it is not > >> > defined then it assumes the version is below 2.3.0 and all the > >> > FPC_HAS_FEATURE_XXX confitionals are defined in the systemh.inc > >> > source. > >> > > >> > For lazarus this means that it should either > >> > - Not define FPC_HAS_FEATURE_SUPPORT > >> > - Or define all FPC_HAS_FEATURE_XXX constants. > >> > - Or maybe even check the compiler binary using the above > >> > method... > >> > >> The best solution is using the PPUs instead of sources. > > > > Using which PPU reader? > > See the mail thread in june 2008 with a proposal to create a fcl-ppu > package independent of the compiler. > > http://www.hu.freepascal.org/lists/fpc-pascal/2008-June/017744.html I started a platform independent ppu reader in the codetools. Writing a simple parser is easy, writing a ppu find declaration is a lot of work and does not solve all problems. So this is a good solution and for some cases the best solution, but it is a long term solution and not available in the foreseeable future.

And did you fix the 'TObject not found' with a short-term solution ? :-)

Michael.

Reply by email

Michael Van Canneyt
to Vincent Snijders
Vincent Snijders wrote 5 lines
Michael Van Canneyt schreef: > > And did you fix the 'TObject not found' with a short-term solution ? :-) Maybe svn up -r11887 (in fpc/trunk)

home: >svn log -r 11887 .
------------------------------------------------------------------------ r11887 | marco | 2008-10-12 13:14:35 +0200 (Sun, 12 Oct 2008) | 2 lines

* some more minor fixes to the debug info

This hardly seems to help the cause ?

Michael.

Reply by email

Vincent Snijders
to Michael Van Canneyt
Michael Van Canneyt wrote 15 lines
On Thu, 23 Oct 2008, Vincent Snijders wrote: > Michael Van Canneyt schreef: >> And did you fix the 'TObject not found' with a short-term solution ? :-) > Maybe svn up -r11887 (in fpc/trunk) home: >svn log -r 11887 . ------------------------------------------------------------------------ r11887 | marco | 2008-10-12 13:14:35 +0200 (Sun, 12 Oct 2008) | 2 lines * some more minor fixes to the debug info This hardly seems to help the cause ?

No, r11888 is the problem. Fixed in Lazarus r17112.

Vincent

Reply by email

Michael Van Canneyt
to Vincent Snijders
Vincent Snijders wrote 18 lines
Michael Van Canneyt schreef: > > On Thu, 23 Oct 2008, Vincent Snijders wrote: > > > Michael Van Canneyt schreef: > > > And did you fix the 'TObject not found' with a short-term solution ? :-) > > Maybe svn up -r11887 (in fpc/trunk) > > home: >svn log -r 11887 . > ------------------------------------------------------------------------ > r11887 | marco | 2008-10-12 13:14:35 +0200 (Sun, 12 Oct 2008) | 2 lines > > * some more minor fixes to the debug info > > This hardly seems to help the cause ? > No, r11888 is the problem. Fixed in Lazarus r17112.

Thank you VERY much !

It was a real pain. Code completion stopped functioning for the largest part, and only then you realize how much you rely on it...

Michael.

Reply by email