original files of m241
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
/* vxmux_util.h - conventional utility macros for VxWorks */
|
||||
|
||||
#ifndef VXMUX_UTIL_H
|
||||
#define VXMUX_UTIL_H
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define member_to_object(pMember, type, memberName) \
|
||||
((type *)((char *)(pMember) - offsetof (type, memberName)))
|
||||
|
||||
|
||||
#ifdef VXMUX_NDEBUG
|
||||
#define VXMUX_ASSERT(x) ((void)0)
|
||||
#else
|
||||
void __vxmux_assert(const char *msg);
|
||||
|
||||
#define _MKSTRING(s) _MKSTRING2(s)
|
||||
#define _MKSTRING2(s) #s
|
||||
|
||||
#define VXMUX_ASSERT(x) \
|
||||
((void)((x) ? ((void)0) : \
|
||||
__vxmux_assert("Assertion failed: "#x", file " __FILE__ \
|
||||
", line "_MKSTRING(__LINE__)"\n")))
|
||||
#endif /* VXMUX_NDEBUG */
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* VXMUX_UTIL_H */
|
||||
Reference in New Issue
Block a user