SENF_PARSER_BITFIELD_RO ( checksumPresent, 1, bool );
SENF_PARSER_PRIVATE_BITFIELD ( reserved0_5bits_, 5, unsigned );
SENF_PARSER_SKIP_BITS ( 7 );
- SENF_PARSER_PRIVATE_BITFIELD ( version_, 3, unsigned );
+ SENF_PARSER_BITFIELD_RO ( version, 3, unsigned );
\endcode
- We have added an additional private bitfield \a reserved0_5bits_() and we made the \a version_()
- field private since we do not want the user to change the value (0 is the only valid value, any
- other value is not supported by this parser anyways). In this special case, a read-only field
- would do. But more generally, if there are fields which must have a fixed value, they must be
- defined as private fields so they can be initialized by the parser to their correct value (see
- next section on how). An additional public read-only accessor allows users of the parser to read
- out the value (but not change it).
+ We have added an additional private bitfield \a reserved0_5bits_() and we made the \a version()
+ field read-only.
- We will now add two additional simple members to the parser
+ We will now add a simple additional member to the parser:
\code
- typedef version__t version_t;
- version_t::value_type version() const { return version_(); }
-
bool valid() const { return version() == 0 && reserved0_5bits_() == 0; }
\endcode
- I think, both are quite straight forward: \a version() will allow the user to read out the value
- of the version field. However, since it does \e not return a parser but a numeric value, the
- access is read-only. The \a valid() member will just check the restrictions as defined in the RFC.
+ I think, this is quite straight forward: \a valid() will just check the restrictions as defined
+ in the RFC.
Now to the packet type. We want to refrain from parsing the payload if the packet is
invalid. This is important: If the packet is not valid, we have no idea, whether the payload is
SENF_PARSER_INIT() { version_() << 1u; }
\endcode
- to \c GREPacketParser. Here we see, why we have defined \a version_() as a private and not a
- read-only field.
+ to \c GREPacketParser. For every read-only defined field, the macros automatically define a \e
+ private read-write accessor which may be used internally. This read-write accessor is used here
+ to initialize the value.
\section howto_newpacket_final The ultimate GRE packet implementation completed
SENF_PARSER_BITFIELD_RO ( checksumPresent, 1, bool );
SENF_PARSER_PRIVATE_BITFIELD ( reserved0_5bits_, 5, unsigned );
SENF_PARSER_SKIP_BITS ( 7 );
- SENF_PARSER_PRIVATE_BITFIELD ( version_, 3, unsigned );
+ SENF_PARSER_BITFIELD_RO ( version, 3, unsigned );
SENF_PARSER_FIELD ( protocolType, senf::UInt16Parser );
BOOST_CHECK_EQUAL(p->refcount(), 0);
p->add_ref();
BOOST_CHECK_EQUAL(p->refcount(), 1);
-#ifndef SENF_NO_DEBUG
+#ifdef SENF_DEBUG
BOOST_CHECK_EQUAL(
senf::pool_alloc_mixin<senf::detail::PacketImpl>::allocCounter(), 1u);
#endif
p,p->begin(),p->end(), senf::PacketInterpreterBase::Append));
// Hmm ... this check works as long as sizeof(PacketInterpreterBase> !=
// sizeof(PacketImpl) ... !!
-#ifndef SENF_NO_DEBUG
+#ifdef SENF_DEBUG
BOOST_CHECK_EQUAL(
senf::pool_alloc_mixin< senf::PacketInterpreter<VoidPacket> >::allocCounter(), 1u);
#endif
p->truncateInterpreters(pi.get());
BOOST_CHECK_EQUAL(p->refcount(),1);
}
-#ifndef SENF_NO_DEBUG
+#ifdef SENF_DEBUG
BOOST_CHECK_EQUAL(
senf::pool_alloc_mixin<senf::PacketInterpreterBase>::allocCounter(), 0u);
#endif
// Therefore we can safely delete the object.
BOOST_CHECK_EQUAL(p->refcount(), 1);
p->release();
-#ifndef SENF_NO_DEBUG
+#ifdef SENF_DEBUG
BOOST_CHECK_EQUAL(
senf::pool_alloc_mixin<senf::detail::PacketImpl>::allocCounter(), 0u);
#endif
BOOST_CHECK_EQUAL(p->refcount(), 1);
p->release();
-#ifndef SENF_NO_DEBUG
+#ifdef SENF_DEBUG
BOOST_CHECK_EQUAL(
senf::pool_alloc_mixin<senf::detail::PacketImpl>::allocCounter(), 0u);
#endif
template <class PacketType>
prefix_ void senf::detail::PacketRegistryImpl<KeyType>::registerPacket(key_t key)
{
-#ifdef SENF_NO_DEBUG
+#ifndef SENF_DEBUG
registry_.insert(std::make_pair(key, Entry_ptr(new detail::PkReg_EntryImpl<PacketType>())));
reverseRegistry_.insert(std::make_pair(senf::typeIdValue<PacketType>(), key));
#else
\par ""
\ref SENF_PARSER_FIELD(), \ref SENF_PARSER_FIELD_RO(), \ref SENF_PARSER_PRIVATE_FIELD(),
- \ref SENF_PARSER_PRIVATE_FIELD_RO(), SENF_PARSER_CUSTOM_FIELD()
+ \ref SENF_PARSER_CUSTOM_FIELD()
There are quite a few commands available to define fields. All these macros do the same thing:
they define a field accessor plus some auxiliary symbols. The accessor will use the parser type
The field defining macros come in groups which members only differ in their properties:
<dl><dt><em>Standard fields:</em><dt><dd>\ref SENF_PARSER_FIELD(), \ref SENF_PARSER_FIELD_RO(),
- \ref SENF_PARSER_PRIVATE_FIELD(), \ref SENF_PARSER_PRIVATE_FIELD_RO() define standard
- fields.</dd>
+ \ref SENF_PARSER_PRIVATE_FIELD() define standard fields.</dd>
<dt><em>Arbitrary custom field:</em><dt><dd>\ref SENF_PARSER_CUSTOM_FIELD()</dd></dl>
\par ""
\ref SENF_PARSER_BITFIELD(), \ref SENF_PARSER_BITFIELD_RO(), \ref
- SENF_PARSER_PRIVATE_BITFIELD(), \ref SENF_PARSER_PRIVATE_BITFIELD_RO() \n
+ SENF_PARSER_PRIVATE_BITFIELD()\n
Bit-fields play a special role. They are quite frequent in packet definitions but don't fit into
the byte offset based parsing infrastructure defined so far. Since defining the correctly
<dl><dt><em>return_type</em> <em>name</em><tt>()</tt> <tt>const</tt></dt><dd>The accessor member
will return the parsed value when called. For normal fields, <em>return_type</em> equals
<em>type</em>, the type of the sub parser. This allows to change the value via the returned
- sub-parser. If the field is marked read-only (\ref SENF_PARSER_FIELD_RO() or \ref
- SENF_PARSER_PRIVATE_FIELD_RO()), the return type will be
- <em>type</em>::<tt>value_type</tt>.</dd>
+ sub-parser. If the field is marked read-only (\ref SENF_PARSER_FIELD_RO()), the return type
+ will be <em>type</em>::<tt>value_type</tt>.</dd>
<dt><tt>typedef</tt> <em>type</em> <em>name</em><tt>_t</tt></dt><dd>This typedef symbol is an
alias for the fields type.</dd>
\param[in] name field name
\param[in] type parser type
- \see \ref SENF_PARSER_FIELD_RO(), \ref SENF_PARSER_PRIVATE_FIELD(), \ref
- SENF_PARSER_PRIVATE_FIELD_RO()
+ \see \ref SENF_PARSER_FIELD_RO(), \ref SENF_PARSER_PRIVATE_FIELD()
\hideinitializer
*/
#define SENF_PARSER_FIELD(name, type)
Define read-only parser field. Read-only fields may only be defined for \a type's which are
value parsers: The parser \a type must have a \c value_type typedef member and a \c value()
member, which returns the current value of the field.
+
+ Defining such a field really defines \e two accessors: A read/write \e private field and a
+ read-only \e public accessor. The name of the private read/write field is given by adding a
+ trailing '_' to \a name. The read-only public accessor is called \a name.
\see SENF_PARSER_FIELD()
\hideinitializer
*/
#define SENF_PARSER_PRIVATE_FIELD(name, type)
-/** \brief Define parser field (private + read-only)
-
- Define a read-only parser field which is marked as \c private and may only be accessed from the
- parser class itself. Read-only fields may only be defined for \a type's which are value parsers:
- The parser \a type must have a \c value_type typedef member and a \c value() member, which
- returns the current value of the field.
-
- \see SENF_PARSER_FIELD()
- \hideinitializer
- */
-#define SENF_PARSER_PRIVATE_FIELD_RO(name, type)
-
/** \brief Define custom field accessor
This macro is used to define a field using a custom access method:
\param[in] bits number of bits
\param[in] type bit field type, one of \c signed, \c unsigned or \c bool
- \see \ref SENF_PARSER_BITFIELD_RO(), \ref SENF_PARSER_PRIVATE_BITFIELD(), \ref
- SENF_PARSER_PRIVATE_BITFIELD_RO()
-
+ \see \ref SENF_PARSER_BITFIELD_RO(), \ref SENF_PARSER_PRIVATE_BITFIELD()
\hideinitializer
*/
#define SENF_PARSER_BITFIELD(name, bits, type)
/** \brief Define bit-field (read-only)
- Define read-only bit field.
+ Define read-only bit field. This is for bit-fields what \ref SENF_PARSER_FIELD_RO is for ordinary fields.
- \see \ref SENF_PARSER_BITFIELD()
+ \see \ref SENF_PARSER_BITFIELD() \n \ref SENF_PARSER_FIELD_RO()
\hideinitializer
*/
#define SENF_PARSER_BITFIELD_RO(name, bits, type)
*/
#define SENF_PARSER_PRIVATE_BITFIELD(name, bits, type)
-/** \brief Define bit-field (private + read-only)
-
- Define a read-only bit field which is marked as \c private and may only be accessed from the
- parser class itself.
-
- \see \ref SENF_PARSER_BITFIELD()
- \hideinitializer
- */
-#define SENF_PARSER_PRIVATE_BITFIELD_RO(name, bits, type)
-
///@}
///\name Current offset
#else
-#define SENF_PARSER_INHERIT BOOST_PP_CAT(SENF_PARSER_INHERIT_, SENF_PARSER_TYPE)
+#define SENF_PARSER_INHERIT BOOST_PP_CAT( SENF_PARSER_INHERIT_, SENF_PARSER_TYPE )
-#define SENF_PARSER_FIELD BOOST_PP_CAT(SENF_PARSER_FIELD_, SENF_PARSER_TYPE)
-#define SENF_PARSER_FIELD_RO BOOST_PP_CAT(SENF_PARSER_FIELD_RO_, SENF_PARSER_TYPE)
-#define SENF_PARSER_BITFIELD BOOST_PP_CAT(SENF_PARSER_BITFIELD_, SENF_PARSER_TYPE)
-#define SENF_PARSER_BITFIELD_RO BOOST_PP_CAT(SENF_PARSER_BITFIELD_RO_, SENF_PARSER_TYPE)
-#define SENF_PARSER_CUSTOM_FIELD BOOST_PP_CAT(SENF_PARSER_CUSTOM_FIELD_, SENF_PARSER_TYPE)
+#define SENF_PARSER_FIELD BOOST_PP_CAT( SENF_PARSER_FIELD_, SENF_PARSER_TYPE )
+#define SENF_PARSER_FIELD_RO BOOST_PP_CAT( SENF_PARSER_FIELD_RO_, SENF_PARSER_TYPE )
+#define SENF_PARSER_BITFIELD BOOST_PP_CAT( SENF_PARSER_BITFIELD_, SENF_PARSER_TYPE )
+#define SENF_PARSER_BITFIELD_RO BOOST_PP_CAT( SENF_PARSER_BITFIELD_RO_, SENF_PARSER_TYPE )
+#define SENF_PARSER_CUSTOM_FIELD BOOST_PP_CAT( SENF_PARSER_CUSTOM_FIELD_, SENF_PARSER_TYPE )
-#define SENF_PARSER_PRIVATE_FIELD BOOST_PP_CAT(SENF_PARSER_P_FIELD_, SENF_PARSER_TYPE)
-#define SENF_PARSER_PRIVATE_FIELD_RO BOOST_PP_CAT(SENF_PARSER_P_FIELD_RO_, SENF_PARSER_TYPE)
-#define SENF_PARSER_PRIVATE_BITFIELD BOOST_PP_CAT(SENF_PARSER_P_BITFIELD_, SENF_PARSER_TYPE)
-#define SENF_PARSER_PRIVATE_BITFIELD_RO BOOST_PP_CAT(SENF_PARSER_P_BITFIELD_RO_, SENF_PARSER_TYPE)
+#define SENF_PARSER_PRIVATE_FIELD BOOST_PP_CAT( SENF_PARSER_P_FIELD_, SENF_PARSER_TYPE )
+#define SENF_PARSER_PRIVATE_BITFIELD BOOST_PP_CAT( SENF_PARSER_P_BITFIELD_, SENF_PARSER_TYPE )
-#define SENF_PARSER_SKIP BOOST_PP_CAT(SENF_PARSER_SKIP_, SENF_PARSER_TYPE)
-#define SENF_PARSER_SKIP_BITS BOOST_PP_CAT(SENF_PARSER_SKIP_BITS_, SENF_PARSER_TYPE)
-#define SENF_PARSER_GOTO BOOST_PP_CAT(SENF_PARSER_GOTO_, SENF_PARSER_TYPE)
-#define SENF_PARSER_GOTO_OFFSET BOOST_PP_CAT(SENF_PARSER_GOTO_OFFSET_, SENF_PARSER_TYPE)
-#define SENF_PARSER_LABEL BOOST_PP_CAT(SENF_PARSER_LABEL_, SENF_PARSER_TYPE)
+#define SENF_PARSER_SKIP BOOST_PP_CAT( SENF_PARSER_SKIP_, SENF_PARSER_TYPE )
+#define SENF_PARSER_SKIP_BITS BOOST_PP_CAT( SENF_PARSER_SKIP_BITS_, SENF_PARSER_TYPE )
+#define SENF_PARSER_GOTO BOOST_PP_CAT( SENF_PARSER_GOTO_, SENF_PARSER_TYPE )
+#define SENF_PARSER_GOTO_OFFSET BOOST_PP_CAT( SENF_PARSER_GOTO_OFFSET_, SENF_PARSER_TYPE )
+#define SENF_PARSER_LABEL BOOST_PP_CAT( SENF_PARSER_LABEL_, SENF_PARSER_TYPE )
-#define SENF_PARSER_OFFSET BOOST_PP_CAT(SENF_PARSER_OFFSET_, SENF_PARSER_TYPE)
-#define SENF_PARSER_FIXED_OFFSET BOOST_PP_CAT(SENF_PARSER_FIXED_OFFSET_,SENF_PARSER_TYPE)
-#define SENF_PARSER_CURRENT_FIXED_OFFSET BOOST_PP_CAT(SENF_PARSER_CURRENT_FIXED_OFFSET_, SENF_PARSER_TYPE)
+#define SENF_PARSER_OFFSET BOOST_PP_CAT( SENF_PARSER_OFFSET_, SENF_PARSER_TYPE )
+#define SENF_PARSER_FIXED_OFFSET BOOST_PP_CAT( SENF_PARSER_FIXED_OFFSET_, SENF_PARSER_TYPE )
+#define SENF_PARSER_CURRENT_FIXED_OFFSET BOOST_PP_CAT( SENF_PARSER_CURRENT_FIXED_OFFSET_, SENF_PARSER_TYPE )
-#define SENF_PARSER_FINALIZE BOOST_PP_CAT(SENF_PARSER_FINALIZE_, SENF_PARSER_TYPE)
+#define SENF_PARSER_FINALIZE BOOST_PP_CAT( SENF_PARSER_FINALIZE_, SENF_PARSER_TYPE )
#endif
# define SENF_PARSER_FIELD_RO_fix(name, type) SENF_PARSER_FIELD_I(name, type, fix, ro, public)
#
# define SENF_PARSER_P_FIELD_var(name, type) SENF_PARSER_FIELD_I(name, type, var, rw, private)
-# define SENF_PARSER_P_FIELD_RO_var(name, type) SENF_PARSER_FIELD_I(name, type, var, ro, private)
# define SENF_PARSER_P_FIELD_fix(name, type) SENF_PARSER_FIELD_I(name, type, fix, rw, private)
-# define SENF_PARSER_P_FIELD_RO_fix(name, type) SENF_PARSER_FIELD_I(name, type, fix, ro, private)
#
# define SENF_PARSER_FIELD_I(name, type, ofstype, rwtype, access) \
access: \
# ////////////////////////////////////////
# // SENF_PARSER_I_FIELD_INIT_*
#
-# define SENF_PARSER_I_FIELD_INIT_rw(name, type, access) \
+# define SENF_PARSER_I_FIELD_INIT_rw(name, type, access) \
private: \
void init_chain(senf::mpl::rv<BOOST_PP_CAT(name,_index)>*) const { \
init_chain(static_cast<senf::mpl::rv<BOOST_PP_CAT(name,_index)-1>*>(0)); \
} \
access:
#
-# define SENF_PARSER_I_FIELD_INIT_ro(name, type, access) \
+# define SENF_PARSER_I_FIELD_INIT_ro(name, type, access) \
private: \
void init_chain(senf::mpl::rv<BOOST_PP_CAT(name,_index)>*) const { \
init_chain(static_cast<senf::mpl::rv<BOOST_PP_CAT(name,_index)-1>*>(0)); \
}
#
# define SENF_PARSER_I_FIELD_VAL_ro(name, type, access) \
+ private: \
+ BOOST_PP_CAT(name, _t) BOOST_PP_CAT(name, _)() const { \
+ return parse<type>( SENF_PARSER_OFFSET(name) ); \
+ } \
+ access: \
BOOST_PP_CAT(name, _t)::value_type name() const { \
- return parse<type>( SENF_PARSER_OFFSET(name) ).value(); \
+ return BOOST_PP_CAT(name,_)(); \
}
#
# ///////////////////////////////////////////////////////////////////////////
# // SENF_PARSER_CUSTOM_FIELD_*
#
-# define SENF_PARSER_CUSTOM_FIELD_var(name, type, size, isize) \
+# define SENF_PARSER_CUSTOM_FIELD_var(name, type, size, isize) \
SENF_PARSER_CUSTOM_FIELD_I(name, type, size, isize, var)
-# define SENF_PARSER_CUSTOM_FIELD_fix(name, type, size) \
+# define SENF_PARSER_CUSTOM_FIELD_fix(name, type, size) \
SENF_PARSER_CUSTOM_FIELD_I(name, type, size, size, fix)
#
# define SENF_PARSER_CUSTOM_FIELD_I(name, type, size, isize, ofstype) \
#
# define SENF_PARSER_P_BITFIELD_var(name, bits, type) \
SENF_PARSER_BITFIELD_I(name, bits, type, var, rw, private)
-# define SENF_PARSER_P_BITFIELD_RO_var(name, bits, type) \
- SENF_PARSER_BITFIELD_I(name, bits, type, var, ro, private)
# define SENF_PARSER_P_BITFIELD_fix(name, bits, type) \
SENF_PARSER_BITFIELD_I(name, bits, type, fix, rw, private)
-# define SENF_PARSER_P_BITFIELD_RO_fix(name, bits, type) \
- SENF_PARSER_BITFIELD_I(name, bits, type, fix, ro, private)
#
# ////////////////////////////////////////
# // SENF_PARSER_BITFIELD_I
env.Append(
CPPPATH = [ '#/include' ],
LIBS = [ 'iberty', '$BOOSTREGEXLIB' ],
+ TEST_EXTRA_LIBS = [ '$BOOSTFSLIB' ],
DOXY_XREF_TYPES = [ 'bug', 'fixme', 'todo', 'idea' ],
DOXY_HTML_XSL = '#/doclib/html-munge.xsl',
ENV = { 'TODAY' : str(datetime.date.today()),
<table class="senf">
<tr><th>Prefix</th> <th>Description</th> <th>Definition</th> <th>Note</th></tr>
<tr><td><tt>::/96</tt></td> <td>IPv4 compatible IPv6 address</td> <td>RFC4291</td> <td>deprecated</td></tr>
- <tr><td><tt>::ffff:0:0/96</tt></td> <td>IPv6 mapped IPv4 address</td> <td>RFC4291</td> <td></td></tr>
+ <tr><td><tt>\::ffff:0:0/96</tt></td> <td>IPv6 mapped IPv4 address</td> <td>RFC4291</td> <td></td></tr>
<tr><td><tt>2000::/3</tt></td> <td>Global unicast addresses</td> <td>RFC3587</td> <td>only noted, not defined</td></tr>
<tr><td><tt>2001:db8::/32</tt></td> <td>Documentation-only prefix</td> <td>RFC3849</td> <td></td></tr>
<tr><td><tt>2002::/16</tt></td> <td>6to4 addressing</td> <td>RFC3056</td> <td></td></tr>
if (sockaddr_.sin6_scope_id == 0)
return "";
char buffer[IFNAMSIZ];
-#ifndef SENF_NO_DEBUG
+#ifdef SENF_DEBUG
SENF_ASSERT( if_indextoname(sockaddr_.sin6_scope_id,buffer) );
#else
if_indextoname(sockaddr_.sin6_scope_id,buffer);
/** \brief Multicast protocol facet for INet4 addressable multicast enabled sockets
*/
class INet4MulticastSocketProtocol
- : public virtual SocketProtocol
+ : public MulticastSocketProtocol
{
public:
void mcAddMembership(INet4Address const & mcAddr) const;
/** \brief Multicast protocol facet for INet6 addressable multicast enabled sockets
*/
class INet6MulticastSocketProtocol
- : public virtual SocketProtocol
+ : public MulticastSocketProtocol
{
public:
void mcAddMembership(INet6Address const & mcAddr) const;
public BSDSocketProtocol,
public AddressableBSDSocketProtocol,
public DatagramSocketProtocol,
- public MulticastSocketProtocol,
public INet4MulticastSocketProtocol
{
public:
public BSDSocketProtocol,
public AddressableBSDSocketProtocol,
public DatagramSocketProtocol,
- public MulticastSocketProtocol,
public INet6MulticastSocketProtocol
{
public:
class UDPv4SocketProtocol
: public ConcreteSocketProtocol<UDPv4Socket_Policy, UDPv4SocketProtocol>,
public UDPSocketProtocol,
- public MulticastSocketProtocol,
public INet4MulticastSocketProtocol,
public BSDSocketProtocol,
public DatagramSocketProtocol,
class UDPv6SocketProtocol
: public ConcreteSocketProtocol<UDPv6Socket_Policy, UDPv6SocketProtocol>,
public UDPSocketProtocol,
- public MulticastSocketProtocol,
public INet6MulticastSocketProtocol,
public BSDSocketProtocol,
public DatagramSocketProtocol,
<dt><em>readPolicy</em></dt><dd>configures the readability of the socket</dd>
- <dt><em>writePolicy</em></dt><dd>configures the writability of the socket</dd>
+ <dt><em>writePolicy</em></dt><dd>configures the writability of the socket</dd></dl>
The template senf::SocketPolicy combines these policy axis to form a concrete socket policy. In
a concrete policy, each of these policy axis is assigned a value, the policy value. This value
return e.code;
}
-#ifdef SENF_NO_DEBUG
+#ifndef SENF_DEBUG
catch (std::exception & e) {
std::cerr << "\n*** Fatal exception: " << e.what() << std::endl;
// When deriving from Self you may not change the class's size without
// inheriting from pool_alloc_mixin again. See pool_alloc_mixin documentation.
SENF_ASSERT( size <= sizeof(Self) );
-#ifndef SENF_NO_DEBUG
+#ifdef SENF_DEBUG
allocCounter(1);
#endif
return boost::singleton_pool< pool_alloc_mixin_tag, sizeof(Self) >::malloc();
template <class Self>
prefix_ void senf::pool_alloc_mixin<Self>::operator delete(void * p, size_t size)
{
-#ifndef SENF_NO_DEBUG
+#ifdef SENF_DEBUG
allocCounter(-1);
#endif
boost::singleton_pool< pool_alloc_mixin_tag, sizeof(Self) >::free(p);
}
-#ifndef SENF_NO_DEBUG
+#ifdef SENF_DEBUG
template <class Self>
prefix_ unsigned long senf::pool_alloc_mixin<Self>::allocCounter()
static void operator delete (void *p, size_t size);
///< Operator delete utilizing pool allocation
-#ifndef SENF_NO_DEBUG
+#ifdef SENF_DEBUG
static unsigned long allocCounter();
private:
static unsigned long allocCounter(long delta);
BOOST_AUTO_UNIT_TEST(poolAllocMixin)
{
-#ifndef SENF_NO_DEBUG
+#ifdef SENF_DEBUG
BOOST_CHECK_EQUAL( Test::allocCounter(), 0u );
{
//#include "senfassert.mpp"
///////////////////////////////hh.p////////////////////////////////////////
-#ifdef SENF_NO_DEBUG
+#ifndef SENF_DEBUG
# define SENF_ASSERT(x)
# endif
#
# ifndef SENF_SENFLOG_LIMIT
-# ifdef SENF_NO_DEBUG
+# ifndef SENF_DEBUG
# define SENF_SENFLOG_LIMIT senf::log::IMPORTANT
# else
# define SENF_SENFLOG_LIMIT senf::log::VERBOSE
Source: libsenf
Priority: extra
Maintainer: Stefan Bund <senf-dev@lists.berlios.de>
-Build-Depends: debhelper (>= 5), scons, binutils-dev, libboost-dev,
+Build-Depends: debhelper (>= 5), scons (>= 0.97), binutils-dev, libboost-dev,
libboost-test-dev, libboost-date-time-dev, libboost-regex-dev,
- libboost-filesystem-dev, doxygen, dia, tidy, xsltproc,
+ libboost-filesystem-dev, doxygen (>= 1.5.5), dia, tidy, xsltproc,
graphviz, perl-base, linklint, netpbm
Standards-Version: 3.7.2 Section: libs
else:
test_sources = []
testEnv = env.Copy(**kw)
- testEnv.Prepend(_LIBFLAGS = ' -Wl,-Bstatic -l$BOOSTTESTLIB -l$BOOSTFSLIB -Wl,-Bdynamic ')
+ testEnv.Prepend(_LIBFLAGS = ' -Wl,-Bstatic -l$BOOSTTESTLIB -Wl,-Bdynamic ')
testEnv.Prepend(LIBS = LIBS)
+ testEnv.Append(LIBS = env['TEST_EXTRA_LIBS'])
all_objects = []
if not objects:
objects = []
LIBPATH = [ '$LOCALLIBDIR' ])
if env['final']:
- env.Append(CXXFLAGS = [ '-O3' ],
- CPPDEFINES = [ 'SENF_NO_DEBUG' ])
+ env.Append(CXXFLAGS = [ '-O3' ])
else:
+ # The boost-regex library is not compiled with _GLIBCXX_DEBUG so this fails:
+ # CPPDEFINES = [ '_GLIBCXX_DEBUG' ],
env.Append(CXXFLAGS = [ '-O0', '-g', '-fno-inline' ],
- # The boost-regex library is not compiled with _GLIBCXX_DEBUG so this fails.
- # CPPDEFINES = [ '_GLIBCXX_DEBUG' ],
+ CPPDEFINES = [ 'SENF_DEBUG' ],
LINKFLAGS = [ '-g' ])
env.Append(CPPDEFINES = [ '$EXTRA_DEFINES' ],