mirror of
https://github.com/twisterarmy/twister-core.git
synced 2025-01-23 13:04:17 +00:00
Extend printf warnings to error()
This commit is contained in:
parent
2a739598b1
commit
bcc292b22d
14
src/util.h
14
src/util.h
@ -56,13 +56,22 @@ static const int64 CENT = 1000000;
|
|||||||
|
|
||||||
/* Format characters for (s)size_t and ptrdiff_t */
|
/* Format characters for (s)size_t and ptrdiff_t */
|
||||||
#if defined(_MSC_VER) || defined(__MSVCRT__)
|
#if defined(_MSC_VER) || defined(__MSVCRT__)
|
||||||
|
/* (s)size_t and ptrdiff_t have the same size specifier in MSVC:
|
||||||
|
http://msdn.microsoft.com/en-us/library/tcxf1dw6%28v=vs.100%29.aspx
|
||||||
|
*/
|
||||||
#define PRIszx "Ix"
|
#define PRIszx "Ix"
|
||||||
#define PRIszu "Iu"
|
#define PRIszu "Iu"
|
||||||
#define PRIszd "Id"
|
#define PRIszd "Id"
|
||||||
#else
|
#define PRIpdx "Ix"
|
||||||
|
#define PRIpdu "Iu"
|
||||||
|
#define PRIpdd "Id"
|
||||||
|
#else /* C99 standard */
|
||||||
#define PRIszx "zx"
|
#define PRIszx "zx"
|
||||||
#define PRIszu "zu"
|
#define PRIszu "zu"
|
||||||
#define PRIszd "zd"
|
#define PRIszd "zd"
|
||||||
|
#define PRIpdx "tx"
|
||||||
|
#define PRIpdu "tu"
|
||||||
|
#define PRIpdd "td"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// This is needed because the foreach macro can't get over the comma in pair<t1, t2>
|
// This is needed because the foreach macro can't get over the comma in pair<t1, t2>
|
||||||
@ -154,6 +163,8 @@ std::string real_strprintf(const std::string &format, int dummy, ...);
|
|||||||
#define strprintf(format, ...) real_strprintf(format, 0, __VA_ARGS__)
|
#define strprintf(format, ...) real_strprintf(format, 0, __VA_ARGS__)
|
||||||
std::string vstrprintf(const char *format, va_list ap);
|
std::string vstrprintf(const char *format, va_list ap);
|
||||||
|
|
||||||
|
bool ATTR_WARN_PRINTF(1,2) error(const char *format, ...);
|
||||||
|
|
||||||
/* Redefine printf so that it directs output to debug.log
|
/* Redefine printf so that it directs output to debug.log
|
||||||
*
|
*
|
||||||
* Do this *after* defining the other printf-like functions, because otherwise the
|
* Do this *after* defining the other printf-like functions, because otherwise the
|
||||||
@ -162,7 +173,6 @@ std::string vstrprintf(const char *format, va_list ap);
|
|||||||
*/
|
*/
|
||||||
#define printf OutputDebugStringF
|
#define printf OutputDebugStringF
|
||||||
|
|
||||||
bool error(const char *format, ...);
|
|
||||||
void LogException(std::exception* pex, const char* pszThread);
|
void LogException(std::exception* pex, const char* pszThread);
|
||||||
void PrintException(std::exception* pex, const char* pszThread);
|
void PrintException(std::exception* pex, const char* pszThread);
|
||||||
void PrintExceptionContinue(std::exception* pex, const char* pszThread);
|
void PrintExceptionContinue(std::exception* pex, const char* pszThread);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user