Skip to content
Snippets Groups Projects
Commit f73c1114 authored by g0dil's avatar g0dil
Browse files

BUGFIX: Fix packet regsitry helper macro token pasting

parent 4a35bea6
No related branches found
No related tags found
No related merge requests found
......@@ -30,6 +30,7 @@
#include <map>
#include <boost/utility.hpp> // for boost::noncopyable
#include <boost/optional.hpp>
#include <boost/preprocessor/cat.hpp>
#include "../Utils/Exception.hh"
#include "Packet.hh"
......@@ -200,7 +201,7 @@ packet of which the key is requested
# define SENF_PACKET_REGISTRY_REGISTER( registry, value, type ) \
namespace { \
senf::PacketRegistry< registry >::RegistrationProxy< type > \
packetRegistration_ ## __LINE__ ( value ); \
BOOST_PP_CAT(packetRegistration_, __LINE__) ( value ); \
}
/** \brief Dump all packet registries
......
......@@ -55,13 +55,11 @@ namespace {
struct OtherPacketType : public PacketTypeBase {};
typedef senf::ConcretePacket<OtherPacketType> OtherPacket;
namespace reg {
PacketRegistry<StringTag>::RegistrationProxy<FooPacket> registerFoo ("foo");
PacketRegistry<StringTag>::RegistrationProxy<BarPacket> registerBar ("bar");
}
}
SENF_PACKET_REGISTRY_REGISTER(StringTag, "foo", FooPacket);
SENF_PACKET_REGISTRY_REGISTER(StringTag, "bar", BarPacket);
BOOST_AUTO_UNIT_TEST(packetRegistry_test)
{
PacketRegistry<BaseTag>::registerPacket<FooPacket>(1u);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment