-
Notifications
You must be signed in to change notification settings - Fork 1
/
port.h
53 lines (40 loc) · 900 Bytes
/
port.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
53
#ifndef PORT_H
#define PORT_H
#include <stdio.h>
#if defined (WIN32) || defined (OS2)
#define NON_UNIX
#endif
#define USE_SA_SIGACTION
#if 0
#define false 0
#define true 1
#endif
#ifdef OS2
#define NO_SNPRINTF
typedef enum
{
false = 0,
true = 1
} bool;
#define INCL_DOSQUEUES
#include <os2.h>
#define rmdir(XX) { DosDeleteDir(XX); }
#define chdir(XX) DosSetCurrentDir(XX)
#define file_close(XX) { DosClose(XX); }
#define make_directory(XX) DosCreateDir(XX, NULL)
typedef HFILE FILE_TYPE;
#define pipe(XX) DosCreatePipe(&XX[0], &XX[1], 8 * 1024)
#define sleep(XX) DosSleep((XX) * 1000)
#define exit(XX) DosExit(EXIT_THREAD, XX)
#else
#define file_close(XX) { ::close(XX); }
#define make_directory(XX) mkdir(XX, S_IRWXU)
typedef int FILE_TYPE;
#endif
typedef FILE_TYPE *PFILE_TYPE;
//typedef FILE *PFILE;
#endif
#ifdef NO_SNPRINTF
#define snprintf sprintf
#endif
#define EXIT_CTRL_C 5