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)

  • 相关阅读:
    【转载】Oracle实例和Oracle数据库(Oracle体系结构)
    【转载】Oracle 11g R2 for Win7旗舰版(64位)- 安装
    eclipse 中卸载插件的方法
    eclipse编辑jsp文件和javascript代码很卡解决办法
    ExtJS登陆页面涉及到的几个问题
    一个关于ExtJS4具体控件的详细教程
    ES6与React中this完全解惑
    for, for..in, in, for...of的区别
    Sublime Text3的react代码校验插件
    Sublime Text3中JSX支持Emmet快捷键
  • 原文地址:https://www.cnblogs.com/BloodAndBone/p/1921680.html
Copyright © 2011-2022 走看看