mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 01:26:58 +00:00
merged new xmlrpc-c revision 1472 from https://xmlrpc-c.svn.sourceforge.net/svnroot/xmlrpc-c/trunk
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8545 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
27
libs/xmlrpc-c/lib/util/include/assertx.hpp
Normal file
27
libs/xmlrpc-c/lib/util/include/assertx.hpp
Normal file
@@ -0,0 +1,27 @@
|
||||
#ifndef ASSERTX_HPP_INCLUDED
|
||||
#define ASSERTX_HPP_INCLUDED
|
||||
|
||||
#include <cassert>
|
||||
|
||||
/* The compiler often warns you if you give a function formal parameter a
|
||||
name, but don't use it. But because assert() disappears when doing an
|
||||
optimized build, the compiler doesn't recognize your reference to the
|
||||
parameter in the assert() argument. To avoid the bogus warning in
|
||||
this case, we have ASSERT_ONLY_ARG(), which declares a name for a
|
||||
formal parameter for purposes of assert() only. In cases where an
|
||||
assert() would disappear, ASSERT_ONLY_ARG() disappears too.
|
||||
|
||||
E.g.
|
||||
|
||||
void foo(int const ASSERT_ONLY_ARG(arg1)) {
|
||||
|
||||
assert(arg1 > 0);
|
||||
}
|
||||
*/
|
||||
#ifdef NDEBUG
|
||||
#define ASSERT_ONLY_ARG(x)
|
||||
#else
|
||||
#define ASSERT_ONLY_ARG(x) x
|
||||
#endif
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user