-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathcomm.h
35 lines (28 loc) · 1.07 KB
/
comm.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*************************************************************************
> File Name: comm.h
> Author: bxq
> Mail: [email protected]
> Created Time: Sunday, December 20, 2015 AM07:37:50 CST
************************************************************************/
#ifndef __COMM_H__
#define __COMM_H__
#include <stdio.h>
#define dbg(fmt, ...) do {printf("[DEBUG %s:%d:%s] " fmt, __FILE__, __LINE__, __FUNCTION__, ##__VA_ARGS__);} while(0)
#define info(fmt, ...) do {printf("[INFO %s:%d:%s] " fmt, __FILE__, __LINE__, __FUNCTION__, ##__VA_ARGS__);} while(0)
#define warn(fmt, ...) do {printf("[WARN %s:%d:%s] " fmt, __FILE__, __LINE__, __FUNCTION__, ##__VA_ARGS__);} while(0)
#define err(fmt, ...) do {printf("[ERROR %s:%d:%s] " fmt, __FILE__, __LINE__, __FUNCTION__, ##__VA_ARGS__);} while(0)
#ifdef __WIN32__
#define FD_SETSIZE 1024
#define snprintf _snprintf
#include <winsock2.h>
#endif
#ifdef __LINUX__
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <time.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#endif
#endif