zoukankan      html  css  js  c++  java
  • define宏定义

    #include <stdio.h>
    #include <stdlib.h>
    #include <stdarg.h>
    #include <string.h>
    #include <signal.h>
    #include <sys/types.h>
    #include <sys/stat.h>
    #include <linux/capability.h>

    #define GETARG(a,x) (a->x##_arg)


    static int debug = 0;


    #define __die(condition,format,...) do { \
                                            if(condition) {\
                                                fprintf(stderr,"[error:%04d] ", __LINE__);\
                                                fprintf(stderr, format "\n", ##__VA_ARGS__ ); \
                                                exit(1);\
                                            } \
                                        } while(0)


    #define __fail(format,...) __die(1,format,##__VA_ARGS__)


    #define __abort(r,condition,format,...) do { \
                                                if(condition) {\
                                                    fprintf(stderr,"[error:%04d] ", __LINE__);\
                                                    fprintf(stderr, format "\n", ##__VA_ARGS__ ); \
                                                    return r;\
                                                } \
                                            } while(0)


    #define __debug(format,...) do { \
                                    if(debug){\
                                        fprintf(stdout,"[debug:%04d] ", __LINE__);\
                                        fprintf(stdout, format "\n", ##__VA_ARGS__ ); \
                                    } \
                                } while(0)


    #define __error(format,...) do { \
                                    fprintf(stderr,"[error:%04d] ", __LINE__);\
                                    fprintf(stderr, format "\n", ##__VA_ARGS__ ); \
                                } while(0)

  • 相关阅读:
    SQL server 和Oracle 序列
    AD 域服务简介(一)- 基于 LDAP 的 AD 域服务器搭建及其使用(转)
    Windows Server 2008 R2 搭建DNS服务器(转)
    windows7下搭建HTTP服务器
    解决vcenter 6.0 vcsa安装插件时报错的问题
    Windows server 2008R2系统登录密码破解
    vmware Horizon 7 与远程桌面(mstsc)兼容性问题解决办法
    VCSA服务重启命令
    如何哄女朋友开心(转)
    快速搭建一个本地的FTP服务器 win10及win7
  • 原文地址:https://www.cnblogs.com/BloodAndBone/p/1921680.html
Copyright © 2011-2022 走看看