[webkit-reviews] review granted: [Bug 20511] Remove static initializers on Windows (StaticConstructors.h) : [Attachment 23029] Patch attempt at guard rename and MSVC support

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Aug 27 09:50:37 PDT 2008


Darin Adler <darin at apple.com> has granted danceoffwithyourpantsoff
<danceoffwithyourpantsoff at gmail.com>'s request for review:
Bug 20511: Remove static initializers on Windows (StaticConstructors.h)
https://bugs.webkit.org/show_bug.cgi?id=20511

Attachment 23029: Patch attempt at guard rename and MSVC support
https://bugs.webkit.org/attachment.cgi?id=23029&action=edit

------- Additional Comments from Darin Adler <darin at apple.com>
 92 #if COMPILER(MSVC)
 93 #define HIDE_STATIC_CONSTRUCTORS_FROM_MSVC 1
 94 #else
 95 #define HIDE_STATIC_CONSTRUCTORS_FROM_GCC 1
 96 #endif

If the GCC technique is really GCC-specific, then I think we should guard it
with #if COMPILER too. That might prevent use from having to mention these
STATIC_CONSTRUCTORS macros at all in the config.h file, which would be a good
thing, and might remove the need for the #undef. But that can be done in a
separate patch.

But is the name good? Does this hide static constructors or eliminate them
entirely? We might want to tweak the terminology to be as precise as possible.
I'm not sure what the best terminology is for these global objects that need
load time initialization. And for what exactly we're doing -- eliminating the
load time initialization and replacing it with explicit initialization.

 23 // For WebCore we need to avoid having static constructors.  We use two
hacks

I don't think the term "hacks" is really good here. There's just too much
subjective opinion about what is and is not a "hack". The sentence about
portability is clear and specific enough without using the term "hack". We
should try to use specific language that's more precise

We normally don't use two spaces after periods in comments.

 28 // initializers.  The constructors will never be called and the object will


Should be "objects", not "object".

 31 // We both of these tricks, we then must defined and explicitly call an
init

Missing verb here in "Web both". Typo "defined".

I'll say r=me, since these nitpicks are small things.


More information about the webkit-reviews mailing list