macro.hpp
Go to the documentation of this file.
1
3#pragma once
4
16#ifndef __EMSCRIPTEN__
17# define BY_E(fmt, ...) ::by::richLog(::by::errLv::ERR, __FILENAME__, __func__, __LINE__, fmt "\n", ##__VA_ARGS__)
18# define BY_W(fmt, ...) ::by::richLog(::by::errLv::WARN, __FILENAME__, __func__, __LINE__, fmt "\n", ##__VA_ARGS__)
19# define BY_I(fmt, ...) ::by::richLog(::by::errLv::INFO, __FILENAME__, __func__, __LINE__, fmt "\n", ##__VA_ARGS__)
20#else
21# define BY_E(fmt, ...) void()
22# define BY_W(fmt, ...) void()
23# define BY_I(fmt, ...) void()
24#endif
25#ifdef BY_DEBUG
26# define BY_DE(fmt, ...) BY_E(fmt, ##__VA_ARGS__)
27# define BY_DW(fmt, ...) BY_W(fmt, ##__VA_ARGS__)
28# define BY_DI(fmt, ...) BY_I(fmt, ##__VA_ARGS__)
29#else
30# define BY_DE(fmt, ...) void()
31# define BY_DW(fmt, ...) void()
32# define BY_DI(fmt, ...) void()
33#endif
34
35#undef BY_SIDE_FUNC_3
36#define BY_SIDE_FUNC_3(paramPtr, expr, ret) \
37 { return paramPtr ? expr : ret; }