aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/extension_set.cc
diff options
context:
space:
mode:
authorGravatar temporal <temporal@630680e5-0e50-0410-840e-4b1c322b438d>2009-12-18 08:21:00 +0000
committerGravatar temporal <temporal@630680e5-0e50-0410-840e-4b1c322b438d>2009-12-18 08:21:00 +0000
commitbdbb863099c7ef3e1ecdeefa732798e095b85fb8 (patch)
tree221b358332016ecb81d2da4f7529be0cdaef1e1f /src/google/protobuf/extension_set.cc
parent91218afc67773ebf85e37d91c80cb3a7d423b0ba (diff)
Ensure that 'once' objects are declared using the macro. This is either the third or fourth time I've screwed this up when down-integrating, because our internal code does not require the macro (it's not portable) and on Linux a pthread_once_t that is zero-initialized just happens to work. So, I only discover the problem when I test on Mac, then kick myself for making the same mistake yet again. No more! This time, I have renamed GoogleOnceType to ProtobufOnceType, thus making the type name differ from our internal code. As a result, if you don't update the decls to use the macros, they won't compile. Hah! Take that, future self!
Diffstat (limited to 'src/google/protobuf/extension_set.cc')
-rw-r--r--src/google/protobuf/extension_set.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/google/protobuf/extension_set.cc b/src/google/protobuf/extension_set.cc
index 615f33c7..b08b4b14 100644
--- a/src/google/protobuf/extension_set.cc
+++ b/src/google/protobuf/extension_set.cc
@@ -62,7 +62,7 @@ inline WireFormatLite::CppType cpp_type(FieldType type) {
typedef hash_map<pair<const MessageLite*, int>,
ExtensionInfo> ExtensionRegistry;
ExtensionRegistry* registry_ = NULL;
-GoogleOnceType registry_init_;
+GOOGLE_PROTOBUF_DECLARE_ONCE(registry_init_);
void DeleteRegistry() {
delete registry_;