macro.h
来自「这是个很好的源代码,有用的」· C头文件 代码 · 共 48 行
H
48 行
// ==============================================================
//
// Copyright (c) 2002-2003 by Alex Vinokur.
//
// For conditions of distribution and use, see
// copyright notice in version.h
//
// ==============================================================
// ##############################################################
//
// SOFTWARE : Turing Machine (C++ Implementation)
// FILE : macro.h
//
// DESCRIPTION :
// Various macro
//
// ##############################################################
// ###############
#ifndef _MACRO_H
#define _MACRO_H
#include "version.h"
#define COUT cout << "[ " << setw(12) << left << __FILE__ << ", " << setw (3) << right << __LINE__ << " ] "
#define FATAL_MSG(t) cout << endl; COUT << "FATAL ERROR : " << t << endl
#define ERROR_MSG(t) cout << endl; COUT << "ERROR : " << t << endl
#define WARNING_MSG(t) COUT << "WARNING : " << t << endl
#define DIAGNOSTIC_MSG(t) cout << endl; COUT << "----------- : " << t << endl
#define INFO_MSG(t) cout << string (20, '#') << endl; cout << "INFO : " << t << endl; cout << string (20, '#') << endl
#define IF_NOT_EMPTY(mg, wd, ch) \
if (!mg.empty()) \
{ \
cout << "\t" << string (wd, ch) << " " << mg << " " << string (wd, ch) << endl; \
}
#define MIN_VALUE(x,y) ((x) < (y) ? (x) : (y))
#define MAX_VALUE(x,y) ((x) > (y) ? (x) : (y))
#define ASSERT(x) if (!(x)) {cerr << endl << endl << "\t=== BUG IN PROGRAM ===" << endl;}; assert (x)
#endif // _MACRO_H
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?