FileGenerator::GenerateBuildDescriptors() emits
"::google::protobuf::internal::OnShutdown(&$shutdownfilename$);" which is
declared in common.h.
Although Protobuf is very well tested a compilation error was triggered while
rolling Protobuf r423:426. There might be something wrong in the Chromium roll
(still in progress).
It seems safer anyway not to rely on indirect headers inclusion.
This does additionally a significant cleanup in platform_macros.h (initially
pulled from v8).
It implemented some subtleties that we don't use like the HOST/TARGET arch
distinction.
Changes related to NaCl support come from Chromium's build/build_config.h.
BUG=392
This patch makes the generation of StaticDescriptorInitializer_$filename$
depend on whether LITE_RUNTIME is enabled. Note that this works only when
extensions are not used.
This lets us significantly decrease the number of static initializers generated
by protoc in LITE_RUNTIME mode (used in Chromium).
In LITE_RUNTIME mode, $adddescriptorsname$() is called the first time that
default_instance() is called (rather than being called during static init).
To benefit from this patch in LITE_RUNTIME mode without extensions, compile
with -DGOOGLE_PROTOBUF_NO_STATIC_INIT.
BUG=351
It is based on V8's new CallOnce(): http://codereview.chromium.org/9447052/.
This patch includes the following changes:
- POD (no static initializer generated) and faster implementation on Windows.
- GoogleOnceInit() can now take an additional parameter which is forwarded to
the function provided by the user.
This patch is part of the static initializers removal initiative.