#ifndef __MACRO_H__
#define __MACRO_H__

// Implements origin `str()` macro. Extremely bad naming.
#include <rlib/macro.hpp>

#define concat(x, y) RLIB_MACRO_CAT(x, y)
#define concat3(x, y, z) concat(concat(x, y), z)
#define concat4(x, y, z, w) concat3(concat(x, y), z, w)
#define concat5(x, y, z, v, w) concat4(concat(x, y), z, v, w)

#ifdef DEBUG
#define RLIB_MACRO_DEBUG_ASSERT(expr) assert(expr)
#else
#define RLIB_MACRO_DEBUG_ASSERT(expr)
#endif

#define RLIB_MACRO_LIKELY(x)       __builtin_expect((x),1)
#define RLIB_MACRO_UNLIKELY(x)     __builtin_expect((x),0)

#endif
