inline const char* const_basename(const char* filepath)
{
const char* base = strrchr(filepath, '/');
#ifdef _WIN32 // Look for either path separator in Windows
if (!base)
base = strrchr(filepath, '\');
#endif
return base ? (base + 1) : filepath;
}
#define ERROR_MSG_HEAD (std::string("[") + const_basename(__FILE__) + "(" + std::to_string(__LINE__) + ") " + __FUNCTION__ + "] ")