Skip to content

Instantly share code, notes, and snippets.

@soulmachine
Created April 23, 2013 03:44
Show Gist options
  • Save soulmachine/5440705 to your computer and use it in GitHub Desktop.
Save soulmachine/5440705 to your computer and use it in GitHub Desktop.
写纯C代码时用的公共头文件
/** @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