WPILibC++ 2025.0.0-alpha-1-14-g3b6f38d
ProtoHelper.h
Go to the documentation of this file.
1// Copyright (c) FIRST and other WPILib contributors.
2// Open Source Software; you can modify and/or share it under the terms of
3// the WPILib BSD license file in the root directory of this project.
4
5#pragma once
6
7#include <google/protobuf/message.h>
8
9namespace wpi {
10template <typename T>
11inline T* CreateMessage(google::protobuf::Arena* arena) {
12#if GOOGLE_PROTOBUF_VERSION < 4000000
13 return google::protobuf::Arena::CreateMessage<T>(arena);
14#else
15 return google::protobuf::Arena::Create<T>(arena);
16#endif
17}
18} // namespace wpi
Definition: ntcore_cpp.h:26
T * CreateMessage(google::protobuf::Arena *arena)
Definition: ProtoHelper.h:11