About:

GNUGoS60 is a port of the FSF's GNU Go game engine to Nokia's S60 smartphone platform running on SymbianOS.

It is Free Software.

Sunday, September 17, 2006

GNU Go for S60 v2.0

Finally got the S60 second edition to stop crashing enough to draw the board. Maaaan that was hard work! Basically I have been working on it for the whole weekend trying to get it to compile once all the global variables I could spot have been stripped out and moved to a dynamic structure stored in Tls().

Really, whoever decided that not supporting global variables was a good idea needs a right good sla^H^H^H *ahem* ... talking to. It is positively the worst OS misfeature I have ever come across. Using Tls() is not even a good solution because there is no migration path to speak of. Basically you have to:

  • go through the code and look for a writable variable (the compiler only accurately warns about some tiny minority of them, so keep your eyes peeled)
  • move the declaration to one place
  • mov the initialization to a different place that doesn't support the previous type of initialization
  • make the runtime inialization work
  • define a macro for the old variable name
  • add the macro to however many dozen files need it
  • workaround any issues in the code that conflict with the macro
Congratulations! You have now migrated one writable static variable to SymbianOS. Now repeat a few hundred times. And if you missed any of them be prepared for this message and some long hours with the debugger:

0 comments: