[webkit-dev] global constructor in WTF?

wei wang flyingwei1986 at gmail.com
Sat May 24 05:12:26 PDT 2014


Hi All,

I just added a declaration in WTF/wtf/DataLog.h, like what we commonly do
in C:

================
namespace WTF{
...
WTF_EXPORT_PRIVATE extern int abc;
...
}
using WTF::abc;
================

Of course, DataLog.cpp has the actual declaration.

However, when compiling with Clang, it emits an error : "declaration
requires a global constructor". I am quite confused about the error
message. How can I write a constructor for abc?

I just want the variable abc to be visible as "dataLog" does. Thanks.

Best
Wei
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-dev/attachments/20140524/cc6c1fce/attachment.html>


More information about the webkit-dev mailing list