-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathcomm.h
37 lines (32 loc) · 1.63 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
35
36
37
#ifndef __COMM_H__
#define __COMM_H__
#include <stdio.h>
#define __LINUX__ 1
#define dbg(fmt, ...) \
do \
{ \
printf("[DEBUG %s:%d] " fmt, __FUNCTION__, __LINE__, ##__VA_ARGS__); \
} while (0)
#define info(fmt, ...) \
do \
{ \
printf("[INFO %s:%d] " fmt, __FUNCTION__, __LINE__, ##__VA_ARGS__); \
} while (0)
#define warn(fmt, ...) \
do \
{ \
printf("[WARN %s:%d] " fmt, __FUNCTION__, __LINE__, ##__VA_ARGS__); \
} while (0)
#define err(fmt, ...) \
do \
{ \
printf("[ERROR %s:%d] " fmt, __FUNCTION__, __LINE__, ##__VA_ARGS__); \
} while (0)
#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