Skip to content

Commit

Permalink
JSON fixed, too.
Browse files Browse the repository at this point in the history
  • Loading branch information
KerstinKeller committed Apr 16, 2024
1 parent 2f67a1e commit ff79d5c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions contrib/ecalproto/src/ecal_proto_dyn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
#include <sstream>
#include <fstream>

#include "google/protobuf/port_def.inc"
#include <google/protobuf/stubs/common.h>

namespace eCAL
{
namespace protobuf
{
#if PROTOBUF_VERSION >= 5026000
#if GOOGLE_PROTOBUF_VERSION >= 5026000
class ParserErrorCollector : public google::protobuf::io::ErrorCollector
{
public:
Expand Down
7 changes: 6 additions & 1 deletion ecal/core/src/pubsub/ecal_proto_dyn_json_sub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
#include <google/protobuf/stubs/common.h>
#include <google/protobuf/util/json_util.h>
#include <google/protobuf/util/type_resolver_util.h>
#include <google/protobuf/util/type_resolver.h>
Expand Down Expand Up @@ -158,7 +159,11 @@ namespace eCAL
{

google::protobuf::util::JsonOptions options;
options.always_print_primitive_fields = true;
#if GOOGLE_PROTOBUF_VERSION >= 5026000
options.always_print_fields_with_no_presence = true;
#else
options.always_print_primitive_fields = true;
#endif

std::string binary_input;
binary_input.assign((char*)data_->buf, static_cast<size_t>(data_->size));
Expand Down

0 comments on commit ff79d5c

Please sign in to comment.