Recent

Author Topic: {$IFDEF LAZ_VERSION} ?  (Read 12306 times)

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: {$IFDEF LAZ_VERSION} ?
« Reply #15 on: November 14, 2014, 01:31:10 pm »
CPU64 etc predefined symbols are there.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Fred vS

  • Hero Member
  • *****
  • Posts: 3812
    • StrumPract is the musicians best friend
Re: {$IFDEF LAZ_VERSION} ?
« Reply #16 on: November 14, 2014, 01:46:08 pm »
Quote
CPU64 etc predefined symbols are there.

Ok, i did a search for predefined symbols but did not find any complete list of  predefined symbols used by fpc.

Ok bis => I stop, i was not able to explain what i wanted, i loose.

By the way, thanks to try to help me.

Fre;D.
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: {$IFDEF LAZ_VERSION} ?
« Reply #17 on: November 14, 2014, 01:50:23 pm »
Riiiiight.... don't know what you searched...

http://www.freepascal.org/docs-html/prog/progsu127.html#x137-1380002.1.1
links to
http://www.freepascal.org/docs-html/prog/progap7.html#x333-348000G

Have fun.

PS: By the way, if you search for CPU64 in the wiki search box, the second hit is this:
http://wiki.lazarus.freepascal.org/Platform_defines
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Zoran

  • Hero Member
  • *****
  • Posts: 1988
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: {$IFDEF LAZ_VERSION} ?
« Reply #18 on: November 14, 2014, 01:52:52 pm »
Swan, ZX Spectrum emulator https://github.com/zoran-vucenovic/swan

Fred vS

  • Hero Member
  • *****
  • Posts: 3812
    • StrumPract is the musicians best friend
Re: {$IFDEF LAZ_VERSION} ?
« Reply #19 on: November 14, 2014, 02:06:09 pm »
Quote
Riiiiight....
=>  :D

Quote
http://www.freepascal.org/docs-html/prog/progsu127.html#x137-1380002.1.1
links to
http://www.freepascal.org/docs-html/prog/progap7.html#x333-348000G

Hum, much better (but not perfect => the list is not complete => random example => "ifdef library" is missing.)

Quote
PS: By the way, if you search for CPU64 in the wiki search box, the second hit is this:

CPU64 was a example, to try to explain what i want...

Quote
In LCL, there are widgetset defines. See:
http://wiki.freepascal.org/Code_Conversion_Guide#Useful_compiler_variables_.2F_defines_.2F_macros

Yep, nice one, it is something like this that i am looking for  (but more exhaustive...)

Thanks.




I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: {$IFDEF LAZ_VERSION} ?
« Reply #20 on: November 14, 2014, 02:35:03 pm »
CPU64 was a example, to try to explain what i want...
Yes, and your point is? Does this mean you cannot use it as a search term?
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12707
  • FPC developer.
Re: {$IFDEF LAZ_VERSION} ?
« Reply #21 on: November 14, 2014, 03:05:50 pm »
Quote
Riiiiight....
=>  :D

Quote
http://www.freepascal.org/docs-html/prog/progsu127.html#x137-1380002.1.1
links to
http://www.freepascal.org/docs-html/prog/progap7.html#x333-348000G

Hum, much better (but not perfect => the list is not complete => random example => "ifdef library" is missing.)

When does FPC define "Library" ?

I tested with compiling a dll, and it doesn't seem to define that. Are you sure you are not confused with some third party define?

Fred vS

  • Hero Member
  • *****
  • Posts: 3812
    • StrumPract is the musicians best friend
Re: {$IFDEF LAZ_VERSION} ?
« Reply #22 on: November 14, 2014, 04:06:34 pm »
Quote
I tested with compiling a dll, and it doesn't seem to define that. Are you sure you are not confused with some third party define?

Hum, let me show a example that is working for me.

It is used by the uos project. => That project let you use uos.pas as "traditional" unit, usable for fpc developers, for their programs.

But a other part of the project is to create a library.

In the main uos.pas unit, there are some :

Code: [Select]
{$IF DEFINED(Library)}
...// do something..
     {$else}
..// do other thing...
     {$endif}

=> So the compiler knows if the main project is a "traditional" program or a library.

And i would have (sorry, im a big curious) a list of all the symbols used by fpc ( => to avoid to use a  {$DEFINE something}  already pre-defined by fpc or Lazarus...

Fre;D



I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Fred vS

  • Hero Member
  • *****
  • Posts: 3812
    • StrumPract is the musicians best friend
Re: {$IFDEF LAZ_VERSION} ?
« Reply #23 on: November 14, 2014, 04:59:35 pm »
Quote
When does FPC define "Library" ?

Ooooops, Marcov, i apologize  :-[, indeed  "Library" is not yet define by fpc, it is me who defined it in top of uos.pas unit (and user has to uncomment it manually if he want a library).

So you see, one more reason to have a complete list of pre-defined things...  :-X

Fre;D
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12707
  • FPC developer.
Re: {$IFDEF LAZ_VERSION} ?
« Reply #24 on: November 14, 2014, 05:48:38 pm »
So you see, one more reason to have a complete list of pre-defined things...  :-X

I still have not seen any indication that the manual isn't. Of course there are undocumented defines, but they are not documented on purpose (and usually start with FPC_*)

Even if there are one or two missing,  I don't see the point to start a new documentation initiative.

 

TinyPortal © 2005-2018