diff options
author | Adam Cozzette <acozzette@gmail.com> | 2018-06-25 15:52:29 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-25 15:52:29 -0700 |
commit | d6f346b4d55ae5112934297593ec1c56c3d178a5 (patch) | |
tree | 021b5476160e465a20ef7d4ae4c0524351667233 /src/google/protobuf/generated_message_util.h | |
parent | 3d603f481ed142d0be5e8e4dd6d1cb4457a51405 (diff) | |
parent | 82d3d7d250645322f8a7343188e5ae6246a76414 (diff) |
Merge pull request #4827 from acozzette/merge-3-6-x
Merge 3.6.x branch into master
Diffstat (limited to 'src/google/protobuf/generated_message_util.h')
-rw-r--r-- | src/google/protobuf/generated_message_util.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/google/protobuf/generated_message_util.h b/src/google/protobuf/generated_message_util.h index bdaa561b..4da04cae 100644 --- a/src/google/protobuf/generated_message_util.h +++ b/src/google/protobuf/generated_message_util.h @@ -335,7 +335,16 @@ struct LIBPROTOBUF_EXPORT SCCInfoBase { kRunning = 1, kUninitialized = -1, // initial state }; +#ifndef _MSC_VER std::atomic<int> visit_status; +#else + // MSVC doesnt make std::atomic constant initialized. This union trick + // makes it so. + union { + int visit_status_to_make_linker_init; + std::atomic<int> visit_status; + }; +#endif int num_deps; void (*init_func)(); // This is followed by an array of num_deps |