|
From: Jeremy F. <je...@go...> - 2002-11-06 16:36:46
|
On Wed, 2002-11-06 at 07:01, Nicholas Nethercote wrote: > Yeah... although I can't help the feeling that there should be a way of > doing it so that the skin-writer doesn't have to do anything more than > #include vg_skin.h... bleh. Well, the skin writer has to do some syntactic mucking about to set up all the skin entrypoints, so a single extra line isn't going to hurt too much. > Unless... if a variable is defined as __attribute__ ((weak)), it can be > defined by multiple .o files and the linker won't complain, so long as an > initial value is provided... it just uses whichever definition comes > first. All the definitions would be the same because they all arise from > #include'ing vg_skin, so this should be ok. I think. Unless there are > other complications that I'm not aware of (almost undoubtedly). I think that's trying to hide too much clever stuff. For example, its another thing to go wrong in subtle ways if the various .o files get different definitions. > I guess one danger of this would be that the skin-writer could overwrite > the variables with his own strong versions, but then again the skin-writer > can already do a million stupid things that will screw up the core so that > doesn't make much difference. Given the number of other things a skin writer has to initialize and/or register, a single extra one for interface version is not a huge burden. Far better than making things to clever-clever which becomes confusing if you're trying to track down a problem later. J |