Page 1 of 7 123 ... LastLast
Results 1 to 10 of 69

Thread: GP2X Issues...

  1. #1

    GP2X Issues...

    Quote Originally Posted by paul_nicholls
    I have fixed my program.

    Here are my SDL_getenv findings:

    Call SDL_getenv but don't store the result - works
    call SDL_getenv and store the result in either PChar or AnsiString - doesn't work (hangs the GP2X...)

    Does this help?

    cheers,
    Paul.
    I have the feeling that under GP2X the FPC version of getenv may be broken or that SDL should be using the C getenv and not the FPC fpgetenv. Could you try the following just to be sure where the commented code is...
    [pascal]{$IFDEF UNIX}
    {$IFDEF FPC}
    {$IFDEF GP2X}
    result := getenv(......);
    {$ELSE}
    result := fpcgetenv(......);
    {$ENDIF}
    {$ENDIF}
    {$ENDIF}[/pascal]
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  2. #2

    Re: GP2X Issues...

    Quote Originally Posted by savage
    I have the feeling that under GP2X the FPC version of getenv may be broken or that SDL should be using the C getenv and not the FPC fpgetenv. Could you try the following just to be sure where the commented code is...
    [pascal]{$IFDEF UNIX}
    {$IFDEF FPC}
    {$IFDEF GP2X}
    result := getenv(name);
    {$ELSE}
    result := fpcgetenv(name);
    {$ENDIF}
    {$ENDIF}
    {$ENDIF}[/pascal]
    I tried that and freepascal borked at the line

    Code:
      result &#58;= getenv&#40;name&#41;;
    with Identifier not found "getenv"

    So it looks like I can't use getenv under the GP2X.

    cheers,
    Paul.

  3. #3

    GP2X Issues...

    Is there a GP2X forum where we can confirm that getenv is definitely broken?
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  4. #4

    GP2X Issues...

    I did a small test in C.
    Code:
      char *path = getenv&#40;"PATH"&#41;;
      if &#40;path&#41;
        printf&#40;path&#41;;
      printf&#40;"\n"&#41;;
    produced the following
    Code:
    &#91;root@gp2x dev&#93;$./test2
    /sbin&#58;/usr/sbin&#58;/usr/local/sbin&#58;/bin&#58;/usr/bin&#58;/usr/local/bin
    getenv() definitely works on the GP2X. I don't know what FPC might be doing wrong.

  5. #5

    GP2X Issues...

    Quote Originally Posted by Sly
    getenv() definitely works on the GP2X. I don't know what FPC might be doing wrong.
    Thanks for the test Steve. As you said we just need to find out what FPC is doing.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  6. #6

    GP2X Issues...

    Paul do you know if libc.genenv() is available under GP2X?

    Actually I would have thought the fpgetenv() should work as well. Maybe what is required is a fix in FPC to get fpgetenv() working.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  7. #7

    GP2X Issues...

    Quote Originally Posted by savage
    Paul do you know if libc.genenv() is available under GP2X?

    Actually I would have thought the fpgetenv() should work as well. Maybe what is required is a fix in FPC to get fpgetenv() working.
    There is a libc.so.6 file in the devkitGP2X that may contain getenv, but I am unsure.

    I did find a libc.pas file on a freepascal site that referes to the libc.so.6 file

    Code:
    const
      libcmodulename = 'libc.so.6';
    and this file has the function getenv in it which comes from the libc.so.6 file.

    I hope this helps,
    cheers,
    Paul.

  8. #8

    GP2X Issues...

    Could you change the code in your version of sdl.pas to look like this.

    [pascal]{$IFDEF GP2X}
    result := libc.getenv(name);
    {$ELSE}
    result := fpcgetenv(name);
    {$ENDIF}[/pascal]

    You may have to change the uses clause at the top to include libc for GP2X.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  9. #9

    GP2X Issues...

    Hi Paul or Steve,
    Any joy in getting FPC to recognise either fpcgetenv() or the libc.getenv()?
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  10. #10

    GP2X Issues...

    Quote Originally Posted by savage
    Hi Paul or Steve,
    Any joy in getting FPC to recognise either fpcgetenv() or the libc.getenv()?
    Sorry, I was away for a bit...I will try this shortly.

    cheers,
    Paul.

Page 1 of 7 123 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •