From bdbb863099c7ef3e1ecdeefa732798e095b85fb8 Mon Sep 17 00:00:00 2001 From: temporal Date: Fri, 18 Dec 2009 08:21:00 +0000 Subject: 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! --- src/google/protobuf/extension_set.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/google/protobuf/extension_set.cc') 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, ExtensionInfo> ExtensionRegistry; ExtensionRegistry* registry_ = NULL; -GoogleOnceType registry_init_; +GOOGLE_PROTOBUF_DECLARE_ONCE(registry_init_); void DeleteRegistry() { delete registry_; -- cgit v1.2.3