Browse Source

Add missing guard in atomicops MSVC cc file

pliard@google.com 13 năm trước cách đây
mục cha
commit
6a10204df6

+ 1 - 1
src/google/protobuf/stubs/atomicops_internals_x86_gcc.cc

@@ -33,7 +33,7 @@
 
 #include <cstring>
 
-#include "atomicops.h"
+#include <google/protobuf/stubs/atomicops.h>
 
 // This file only makes sense with atomicops_internals_x86_gcc.h -- it
 // depends on structs that are defined in that file.  If atomicops.h

+ 3 - 0
src/google/protobuf/stubs/atomicops_internals_x86_msvc.cc

@@ -33,6 +33,8 @@
 
 #include <google/protobuf/stubs/atomicops.h>
 
+#ifdef GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_X86_MSVC_H_
+
 #include <windows.h>
 
 namespace google {
@@ -103,4 +105,5 @@ Atomic64 Barrier_AtomicIncrement(volatile Atomic64* ptr,
 }  // namespace protobuf
 }  // namespace google
 
+#endif  // GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_X86_MSVC_H_
 #endif  // GOOGLE_PROTOBUF_NO_THREADSAFETY