-
-
Save ustbgaofan/eb1e17f7b7d88c48129d54eff6efb46e to your computer and use it in GitHub Desktop.
写纯C代码时用的公共头文件
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @file config.h | |
* @brief 公共头文件 | |
* @author [email protected] | |
* @date 2010-8-3 | |
* @version 0.1 | |
* @note 无 | |
*/ | |
#ifndef _CONFIG_H_ | |
#define _CONFIG_H_ | |
#ifdef __cplusplus | |
extern "C" | |
{ | |
#endif | |
#ifndef NULL | |
#ifdef __cplusplus | |
#define NULL 0 | |
#else | |
#define NULL ((void *)0) | |
#endif | |
#endif | |
#ifndef __cplusplus | |
typedef char bool; | |
#define false 0 | |
#define true (!false) | |
#endif | |
/* no error */ | |
#define SUCCESS 0 | |
/* 错误码*/ | |
#define ERR_NULL_POINTER 1 | |
#define ERR_MALLOC_FAILED 2 | |
#define ERR_OTHER 3 | |
#ifdef __cplusplus | |
} | |
#endif /* end of _cplusplus */ | |
#endif /* end of _CONFIG_H_ */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment