浏览代码

Merge pull request #793 from kbinani/fix_redefinition_BYTE_SIZE_macro

Rename 'BYTE_SIZE' macro to 'GOOGLE_PROTOBUF_BYTE_SIZE'
Feng Xiao 10 年之前
父节点
当前提交
63eca470fd
共有 1 个文件被更改,包括 12 次插入12 次删除
  1. 12 12
      src/google/protobuf/map_type_handler.h

+ 12 - 12
src/google/protobuf/map_type_handler.h

@@ -272,24 +272,24 @@ MapTypeHandler<WireFormatLite::TYPE_MESSAGE, Type>::ByteSize(
   return WireFormatLite::MessageSizeNoVirtual(value);
   return WireFormatLite::MessageSizeNoVirtual(value);
 }
 }
 
 
-#define BYTE_SIZE(FieldType, DeclaredType)                                     \
+#define GOOGLE_PROTOBUF_BYTE_SIZE(FieldType, DeclaredType)                     \
   template <typename Type>                                                     \
   template <typename Type>                                                     \
   inline int MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::ByteSize( \
   inline int MapTypeHandler<WireFormatLite::TYPE_##FieldType, Type>::ByteSize( \
       const MapEntryAccessorType& value) {                                     \
       const MapEntryAccessorType& value) {                                     \
     return WireFormatLite::DeclaredType##Size(value);                          \
     return WireFormatLite::DeclaredType##Size(value);                          \
   }
   }
 
 
-BYTE_SIZE(STRING, String)
-BYTE_SIZE(BYTES , Bytes)
-BYTE_SIZE(INT64 , Int64)
-BYTE_SIZE(UINT64, UInt64)
-BYTE_SIZE(INT32 , Int32)
-BYTE_SIZE(UINT32, UInt32)
-BYTE_SIZE(SINT64, SInt64)
-BYTE_SIZE(SINT32, SInt32)
-BYTE_SIZE(ENUM  , Enum)
-
-#undef BYTE_SIZE
+GOOGLE_PROTOBUF_BYTE_SIZE(STRING, String)
+GOOGLE_PROTOBUF_BYTE_SIZE(BYTES , Bytes)
+GOOGLE_PROTOBUF_BYTE_SIZE(INT64 , Int64)
+GOOGLE_PROTOBUF_BYTE_SIZE(UINT64, UInt64)
+GOOGLE_PROTOBUF_BYTE_SIZE(INT32 , Int32)
+GOOGLE_PROTOBUF_BYTE_SIZE(UINT32, UInt32)
+GOOGLE_PROTOBUF_BYTE_SIZE(SINT64, SInt64)
+GOOGLE_PROTOBUF_BYTE_SIZE(SINT32, SInt32)
+GOOGLE_PROTOBUF_BYTE_SIZE(ENUM  , Enum)
+
+#undef GOOGLE_PROTOBUF_BYTE_SIZE
 
 
 #define FIXED_BYTE_SIZE(FieldType, DeclaredType)                               \
 #define FIXED_BYTE_SIZE(FieldType, DeclaredType)                               \
   template <typename Type>                                                     \
   template <typename Type>                                                     \