Explorar el Código

Merged in bugfix/PROTO-65-macro-collision-with-packed-in- (pull request #29)

Renamed a constexpr to a more uniqe name to prevent problems with other libs.
Bart Hertog hace 5 años
padre
commit
57db232a95
Se han modificado 1 ficheros con 4 adiciones y 3 borrados
  1. 4 3
      src/RepeatedField.h

+ 4 - 3
src/RepeatedField.h

@@ -51,7 +51,8 @@ namespace EmbeddedProto
     static_assert(std::is_base_of<::EmbeddedProto::Field, DATA_TYPE>::value, "A Field can only be used as template paramter.");
 
     //! Check how this field shoeld be serialized, packed or not.
-    static constexpr bool PACKED = !std::is_base_of<MessageInterface, DATA_TYPE>::value;
+    static constexpr bool REPEATED_FIELD_IS_PACKED = !std::is_base_of<MessageInterface, 
+                                                                      DATA_TYPE>::value;
 
     public:
 
@@ -134,7 +135,7 @@ namespace EmbeddedProto
       {
         Error return_value = Error::NO_ERRORS;
 
-        if(PACKED)
+        if(REPEATED_FIELD_IS_PACKED)
         {
           const uint32_t size_x = this->serialized_size_packed(field_number);
 
@@ -180,7 +181,7 @@ namespace EmbeddedProto
       Error deserialize(::EmbeddedProto::ReadBufferInterface& buffer) final
       {
         Error return_value = Error::NO_ERRORS;
-        if(PACKED)
+        if(REPEATED_FIELD_IS_PACKED)
         {              
           uint32_t size;
           return_value = WireFormatter::DeserializeVarint(buffer, size);