rstd.cc

来自「C语言前端编译器,yacc/lex编写,可自行修改代码.」· CC 代码 · 共 43 行

CC
43
字号
// Copyright 2000 by Robert Dick.
// All rights reserved.

#include "RStd.h"

#include <iostream>
#include <cstdlib>

/*###########################################################################*/
ostream cerrhex(cerr.rdbuf());
ostream couthex(cout.rdbuf());

namespace {
// Cause hex streams to be initialized.
	int cerr_hex_init() { cerrhex << hex; return 0; }
	int cout_hex_init() { couthex << hex; return 0; }

	int L_cout_hex_init = cout_hex_init();
	int L_cerr_hex_init = cerr_hex_init();
}

/*===========================================================================*/
void rpos(const char * file, int line) {
	cerr << "File: " << file << ", Line: " << line << endl;
}

/*===========================================================================*/
void rabort(const char * file, int line, const char *message) {
	rpos(file, line);
	cerr << message;
	abort();
}

/*===========================================================================*/
void rexit(const char * message) {
	cout << message;
	exit(0);
}

/*###########################################################################*/
void RStd_test() {
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?