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.

C/C++ > Libnds header files contain executable code

#167135 - Dwedit - Tue Mar 03, 2009 12:51 am

In videogl.h:

Lines 301 and 302:
// Pointer to global data for videoGL
static gl_hidden_globals* glGlob = &glGlobalData;

This is executable code which forces the linker to include all of videogl.a, no matter what.
I suggest replacing it with this:

#define glGlob (&glGlobalData)
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#167230 - Dwedit - Fri Mar 06, 2009 9:10 am

Please move this post to "DS Development".
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#167516 - Dwedit - Mon Mar 16, 2009 8:18 pm

The bug only happens when using optimization level -O0. Yuck.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."