• Free Pascal Question

    From Black Panther@21:1/186 to All on Sun Jun 3 20:23:51 2018
    Hi All,

    This may be a stupid question...

    I'm using Lazarus / FreePascal to work on a few programs over here. I'm
    looking at using:

    {$IFDEF Linux}
    OSVersion:='Linux ';
    {$ELSE}
    etc...

    along with:

    {IFDEF CPU32}
    SizeofPoint:='/32';
    {$ELSE}
    {IFDEF CPU64}
    SizeofPoint:='/64';
    {$ENDIF}

    My question is, will this display the information for the compiling program,
    or the system running it? I'm looking for it to display the information from the system running the program, but I don't have a way to test it. All of my Linux systems are running 64 bit...

    Thanks for the help.


    ---

    Black Panther
    a.k.a. Dan Richter
    Sysop - Castle Rock BBS (RCS)
    telnet://bbs.castlerockbbs.com
    http://www.castlerockbbs.com
    The sparrows are flying again....

    --- Mystic BBS v1.12 A39 2018/04/21 (Linux/64)
    * Origin: Castle Rock BBS - bbs.castlerockbbs.com (21:1/186)
  • From fabian@21:2/106 to Black Panther on Thu Jun 14 13:24:52 2018
    Hi Black Panther,

    Sorry for seeing your question only now... not very quick !

    {IFDEF CPU32}
    SizeofPoint:='/32';
    {$ELSE}
    {IFDEF CPU64}
    SizeofPoint:='/64';
    {$ENDIF}
    My question is, will this display the information for the compiling program, or the system running it? I'm looking for it to display the

    Those are compiler directives. The built code won't have any of these inside. It's instructions for the compiler regarding what you want to build. If
    you're cross compiling the source, compiler use those to build with specific options and code for the platform it's compiling.

    I've no clue as to how identify the platform your code is running on however, not using freepascal I mean, but there certainly exists a bunch of ways.

    Sorry for not being more helpful however :S

    Take care,

    Fabian

    þÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄþ
    ³Û²±° BackToTheRoots BBS / Fabian °±²Û³
    þÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄþ

    --- Mystic BBS v1.12 A39 2018/04/21 (Linux/64)
    * Origin: BackToTheRoots BBS (21:2/106)
  • From Black Panther@21:1/186 to fabian on Sun Jun 17 15:27:53 2018
    On 06/14/18, fabian said the following...

    Those are compiler directives. The built code won't have any of these inside. It's instructions for the compiler regarding what you want to build. If you're cross compiling the source, compiler use those to build with specific options and code for the platform it's compiling.

    Thank you. That's kinda what I thought, but wasn't sure.

    I've no clue as to how identify the platform your code is running on however, not using freepascal I mean, but there certainly exists a bunch of ways.

    I'm only looking at being able to see what version is being used, to make
    sure the output is being generated correctly. At least I'll be able to see if it's Linux or Windows.

    So, what do you use, if you don't use FPC? It was my understanding that only FPC and Delphi were still being supported.

    Thanks,


    ---

    Black Panther
    a.k.a. Dan Richter
    Sysop - Castle Rock BBS (RCS)
    telnet://bbs.castlerockbbs.com
    http://www.castlerockbbs.com
    The sparrows are flying again....

    --- Mystic BBS v1.12 A39 2018/04/21 (Linux/64)
    * Origin: Castle Rock BBS - bbs.castlerockbbs.com (21:1/186)
  • From fabian@21:2/106 to Black Panther on Mon Jun 18 06:41:00 2018
    So, what do you use, if you don't use FPC? It was my understanding that only FPC and Delphi were still being supported.

    I'm not fluent enough with Freepascal as I did most of my professional development with Delphi ; you got a lot of components that help with almost anything (including getting the host OS version). However I do not know Freepascal enough to show you the right component to use :(

    Fabian

    þÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄþ
    ³Û²±° BackToTheRoots BBS / Fabian °±²Û³
    þÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄþ

    --- Mystic BBS v1.12 A39 2018/04/21 (Linux/64)
    * Origin: BackToTheRoots BBS (21:2/106)