宏函数打印日志

#define 宏函数

    预定义符号表:     

符号示例含义
__FILE__/home/david/hello.c正在预编译的源文件名
__LINE__5文件当前的行号
__FUNCTION__main当前所在的函数名

    序表:

符号示例含义
__DATE__Mar 01 2016预编译文件的日期
__TIME__23:04:12预编译文件的时间
__STDC__1如果编译器遵循ANSIC,则值为1


#define INFO(format,...) printf("FILE: "__FILE__ ", LINE: %d: " format "\n", __LINK__, ##__VA_ARGS__)

#define max(a,b) ((a)>(b)?(a):(b))

#define min(a,b) ((a)<(b)?(a):(b))

#if defined(_WIN16) || defined(__MSDOS__) || defined(_MSDOS)
// 16 bit systems use long int for 32 bit integer
typedef long int           int32;   // 32 bit signed integer
typedef unsigned long int  uint32;  // 32 bit unsigned integer
#else
// Most other systems use int for 32 bit integer
typedef int                int32;   // 32 bit signed integer
typedef unsigned int       uint32;  // 32 bit unsigned integer
#endif

// Define 64 bit signed and unsigned integers, if possible
#if (defined(__WINDOWS__) || defined(_WIN32)) && (defined(_MSC_VER) || defined(__INTEL_COMPILER))
// Microsoft and other compilers under Windows use __int64
typedef __int64            int64;   // 64 bit signed integer
typedef unsigned __int64   uint64;  // 64 bit unsigned integer
#define INT64_DEFINED               // Remember that int64 is defined
#elif defined(__unix__) && (defined(_M_IX86) || defined(_M_X64))
// Gnu and other compilers under Linux etc. use long long
typedef long long          int64;   // 64 bit signed integer
typedef unsigned long long uint64;  // 64 bit unsigned integer
#define INT64_DEFINED               // Remember that int64 is defined
#else
// 64 bit integers not defined
// You may include definitions for other platforms here
#endif












评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值