Win32实用调试窗口 err.h

#pragma once

#include <assert.h>

#define NOTICE_TXT(txt) \
    txt "\n\n" \
    "这是一个可恢复的错误,请按【忽略】以继续。\n\n" \
    "如果多次出现错误,您可以按【中止】以终止程序。"

#define NOTICE(txt) _assert(NOTICE_TXT(txt), __FILE__, __LINE__)

#define ERR_S(txt) do { \
    NOTICE(txt); \
    exit(1); \
} while (0)

#define assert_notify(condition) do { \
    if (!condition) \
        NOTICE(#condition); \
} while (0)

 

posted @ 2020-08-13 23:43  天天2023  阅读(265)  评论(0)    收藏  举报