Files
botw/lib/sead/include/basis/seadRawPrint.h
T
Léo Lam 18c60323a9 Switch to subrepos
git subrepo clone https://github.com/open-ead/sead lib/sead

subrepo:
  subdir:   "lib/sead"
  merged:   "1b66e825d"
upstream:
  origin:   "https://github.com/open-ead/sead"
  branch:   "master"
  commit:   "1b66e825d"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo"
  commit:   "2f68596"

git subrepo clone (merge) https://github.com/open-ead/nnheaders lib/NintendoSDK

subrepo:
  subdir:   "lib/NintendoSDK"
  merged:   "9ee21399f"
upstream:
  origin:   "https://github.com/open-ead/nnheaders"
  branch:   "master"
  commit:   "9ee21399f"
git-subrepo:
  version:  "0.4.3"
  origin:   "ssh://git@github.com/ingydotnet/git-subrepo"
  commit:   "2f68596"

git subrepo clone https://github.com/open-ead/agl lib/agl

subrepo:
  subdir:   "lib/agl"
  merged:   "7c063271b"
upstream:
  origin:   "https://github.com/open-ead/agl"
  branch:   "master"
  commit:   "7c063271b"
git-subrepo:
  version:  "0.4.3"
  origin:   "ssh://git@github.com/ingydotnet/git-subrepo"
  commit:   "2f68596"

git subrepo clone https://github.com/open-ead/EventFlow lib/EventFlow

subrepo:
  subdir:   "lib/EventFlow"
  merged:   "c35d21b34"
upstream:
  origin:   "https://github.com/open-ead/EventFlow"
  branch:   "master"
  commit:   "c35d21b34"
git-subrepo:
  version:  "0.4.3"
  origin:   "ssh://git@github.com/ingydotnet/git-subrepo"
  commit:   "2f68596"
2022-03-21 21:31:42 +01:00

96 lines
4.9 KiB
C++

#pragma once
#include <cstdarg>
#include <basis/seadTypes.h>
#ifdef SEAD_DEBUG
#define SEAD_ASSERT_MSG(condition, message, ...) \
do \
{ \
if (!(condition)) \
sead::system::HaltWithDetail(__FILE__, __LINE__, message, ##__VA_ARGS__); \
} while (0)
#define SEAD_ASSERT(condition) \
do \
{ \
if (!(condition)) \
sead::system::HaltWithDetailNoFormat(__FILE__, __LINE__, #condition); \
} while (0)
#define SEAD_WARN(message, ...) \
do \
sead::system::Warning(__FILE__, __LINE__, message, ##__VA_ARGS__); \
while (0)
#define SEAD_DEBUG_PRINT(format, ...) \
do \
sead::system::Print(format, ##__VA_ARGS__); \
while (0)
#else
#define SEAD_ASSERT_MSG(condition, message, ...) \
do \
{ \
if (false) \
{ \
static_cast<void>(condition); \
sead::system::detail::CheckFormat(message, ##__VA_ARGS__); \
} \
} while (0)
#define SEAD_ASSERT(condition) \
do \
{ \
if (false) \
static_cast<void>(condition); \
} while (0)
#define SEAD_WARN(message, ...) \
do \
{ \
if (false) \
sead::system::detail::CheckFormat(message, ##__VA_ARGS__); \
} while (0)
#define SEAD_DEBUG_PRINT(format, ...) \
do \
{ \
if (false) \
sead::system::detail::CheckFormat(format, ##__VA_ARGS__); \
} while (0)
#endif
namespace sead
{
namespace system
{
namespace detail
{
// Dummy function whose only purpose is to trigger a format string check.
#ifdef __GNUC__
[[maybe_unused]] [[gnu::format(printf, 1, 2)]]
#endif
inline void
CheckFormat(const char*, ...)
{
}
} // namespace detail
void Halt();
#ifdef __GNUC__
[[gnu::format(printf, 3, 4)]]
#endif
void HaltWithDetail(const char* file, int line, const char* msg, ...);
void HaltWithDetailNoFormat(const char* file, int line, const char* msg);
void DebugBreak();
#ifdef __GNUC__
[[gnu::format(printf, 1, 2)]]
#endif
void Print(const char* format, ...);
void PrintV(const char* format, std::va_list);
void PrintString(const char* format, s32);
#ifdef __GNUC__
[[gnu::format(printf, 3, 4)]]
#endif
void Warning(const char* file, int line, const char* msg, ...);
void SetWarningEnable(bool enable);
} // namespace system
} // namespace sead