forked from jla3378/qtools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
include.h
52 lines (47 loc) · 1.15 KB
/
include.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef __INCLUDE_H__
#define __INCLUDE_H__
#include <stdint.h>
typedef int32_t int32;
typedef uint32_t uint32;
typedef uint8_t uint8;
typedef int8_t int8;
typedef int16_t int16;
typedef uint16_t uint16;
#ifdef WIN32
#define PACKED_ON(name) __pragma(pack(push, 1)) struct name
#define PACKED_OFF __pragma(pack(pop))
#else
#define PACKED_ON(name) struct __attribute__ ((__packed__)) name
#define PACKED_OFF
#endif
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#ifdef WIN32
#include "getopt.h"
#ifndef NO_IO
#include <io.h>
#endif
#include <windows.h>
#else
#include <getopt.h>
#include <termios.h>
#include <unistd.h>
#include <readline/readline.h>
#include <readline/history.h>
#endif
#ifdef WIN32
#include "printf.h"
#define S_IFMT 170000
#define S_IFDIR 40000
#define S_IFBLK 60000
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#define usleep(n) Sleep(n/1000)
#endif
#include "qcio.h"
#include "ptable.h"
#endif