Textractor_test/vnr/ccutil/ccmacro.h

27 lines
712 B
C
Raw Normal View History

2015-04-02 22:29:31 +08:00
#ifndef CCMACRO_H
#define CCMACRO_H
// ccmacro.h
// 12/9/2011 jichi
#include <string>
#define CONCAT_STR_NUM(_str, _num) (std::wstring(_str) + std::to_wstring(_num)).c_str()
#define CONCAT_STR_STR(_str1, _str2) (std::wstring(_str1) + std::wstring(_str2)).c_str()
2015-04-02 22:29:31 +08:00
#define CC_UNUSED(_var) (void)(_var)
#define CC_NOP CC_UNUSED(0)
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
# define CC_LIKELY(expr) __builtin_expect(!!(expr), true)
# define CC_UNLIKELY(expr) __builtin_expect(!!(expr), false)
#else
# define CC_LIKELY(x) (x)
# define CC_UNLIKELY(x) (x)
#endif
#define CC_MIN(x, y) ((x) < (y) ? (x) : (y))
#define CC_MAX(x, y) ((x) < (y) ? (y) : (x))
#endif // CCMACRO_H