gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Problem with DevkitPro r19

#86945 - agentq - Sat Jun 10, 2006 9:55 pm

I may have found a problem with DevkitPro r19. It involves static initialised objects.

If I have an object such as this:
Code:
class Test {

public:
   int a;

   Test(int a) {
      this->a = a;
   }
};

Test foo(123);


Then later print out the contents of foo.a, it's value is 0 rather than 123, as you might expect.

It seems as if the global object constructors are not being called.

I discovered this which trying to build ScummVM with r19. Could this be an issue with my installation? Could I have bits of an older version of DevkitPro around? I installed it using the Windows installer and it seemed to go fine, and it's definately calling the new compiler.

#86954 - wintermute - Sat Jun 10, 2006 11:22 pm

Update to r19a :D
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog

#86956 - agentq - Sat Jun 10, 2006 11:51 pm

Ah. Didn't realise there was a later devkitarm than was included in the devkitpro installer. Can the installer not always download the latest version?

#86973 - wintermute - Sun Jun 11, 2006 2:46 am

It does download the latest version, obviously last time you updated 19a wasn't yet available.

I've noticed that occasionally the updater doesn't download the latest ini file which I guess is due to browser caching. I'm currently looking for a way to ensure the ini file isn't cached. FWIW the ini file was updated about 2 hours before you posted the first message in this thread so you probably hadn't updated since then.
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog

#86975 - tepples - Sun Jun 11, 2006 3:19 am

wintermute wrote:
I've noticed that occasionally the updater doesn't download the latest ini file which I guess is due to browser caching. I'm currently looking for a way to ensure the ini file isn't cached.

Have it run a really short php script that just readfile's the INI, and then have the updater pass a random number.
Code:
http://www.devkitpro.org/latest_ini.php?random=3141592654

There are also cache controls in HTTP that your PHP script can send to specify when a given update expires.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#87043 - swimgod - Sun Jun 11, 2006 6:45 pm

tepples wrote:
wintermute wrote:
I've noticed that occasionally the updater doesn't download the latest ini file which I guess is due to browser caching. I'm currently looking for a way to ensure the ini file isn't cached.

Have it run a really short php script that just readfile's the INI, and then have the updater pass a random number.
Code:
http://www.devkitpro.org/latest_ini.php?random=3141592654

There are also cache controls in HTTP that your PHP script can send to specify when a given update expires.

something as simple as...
Code:

<?php
$file = "/files/my.ini";//place the ini is...
header('Cache-Control: no-cache, must-revalidate');
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');

if(is_file($file)){
  @readfile($file);
}else{
  echo"Error, File not found.";
}
?>


this should work just find :P
_________________

1x WII 2x remotes
2x NDS/L(FMv7-ORG:v4,FMv7-org:DSL)
1x GBAMP
2x 1gb (MicroDrive{typeII}&SanDisk{typeI})
1x SuperPass2
1x Supercard-CF

MoonShell skins

#87045 - tepples - Sun Jun 11, 2006 6:52 pm

Almost. You'll want to check for the existence of the files before you send the HTTP headers so that you can do a proper 404 response if it is not found. And you'll want to get rid of the blank line above the <?php .
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.