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)

  • 相关阅读:
    UESTC--1727
    css3制作左右拉伸动画菜单
    Mysql主从数据库(master/slave),实现读写分离
    阿里云Centos7.6上面部署基于redis的分布式爬虫scrapy-redis将任务队列push进redis
    利用基于Go Lang的Hugo配合nginx来打造属于自己的纯静态博客系统
    Centos7.6上利用docker搭建Jenkins来自动化部署Django项目
    使用基于Vue.js和Hbuilder的混合模式移动开发打造属于自己的移动app
    Centos7.6上部署Supervisor来监控和操作各类服务
    Centos上配置nginx+uwsgi+负载均衡配置
    Websocket---认识篇
  • 原文地址:https://www.cnblogs.com/BloodAndBone/p/1921680.html
Copyright © 2011-2022 走看看