1 /* $Id$
2  * EMX (GNU C on OS/2) compiler-specific declarations
3  *
4  * HUSKYLIB: common defines, types and functions for HUSKY
5  *
6  * This is part of The HUSKY Fidonet Software project:
7  * see http://husky.sourceforge.net for details
8  *
9  *
10  * HUSKYLIB is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 2 of the License, or (at your option) any later version.
14  *
15  * HUSKYLIB is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18  * General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with this library; see file COPYING. If not, write to the
22  * Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23  *
24  * See also http://www.gnu.org, license may be found here.
25  */
26 
27 /* EMX for 32-bit OS/2 and RSX for Windows NT (GNU C) */
28 
29 #ifndef HUSKY_EMX_H
30 #define HUSKY_EMX_H
31 
32 #ifndef __GNUC__
33   #error This file may be used only with GNU C !
34 #endif
35 
36 #ifndef __EMX__
37   #error This file may be used only with EMX (GNU C) on OS/2 !
38 #endif
39 
40 
41 #ifndef __LITTLE_ENDIAN__
42 #  define __LITTLE_ENDIAN__  /* using to select functions/macroses for read & write binary values */
43 #endif
44 
45 #undef __UNIX__
46 
47 #  define _stdc
48 #  define _intr
49 #  define _intcast
50 #  define _veccast
51 #  define _fast
52 #  define _loadds
53 #  define cdecl
54 #  define pascal
55 #  if defined(__32BIT__)
56 #    define near
57 #    undef  far
58 #    define far
59 #    define farread(a,b,c)  read(a,b,c)
60 #    define farwrite(a,b,c) write(a,b,c)
61 #  endif
62 
63 #  define mymkdir(a) mkdir((a), 0)
64 
65 #  define strcasecmp stricmp
66 #  define strncasecmp strnicmp
67 
68 #  define _XPENTRY
69 
70 #  define mysleep(x) sleep(x)
71 #  define HAS_sleep     1  /* sleep(): stdlib.h, unistd.h */
72 #  define HAS_snprintf  1
73 #  define HAS_vsnprintf 1
74 #  define HAS_strlwr    1  /* strlwr() in string.h */
75 #  define HAS_strupr    1  /* strupr() in string.h */
76 //#  define HAS_getpid    1  /* getpid() in process.h, unistd.h */
77 #  define HAS_spawnvp   1  /* spawnvp() in process.h */
78 #  define HAS_strftime  1  /* strftime() in time.h  */
79 #  define HAS_mktime    1  /* mktime() in time.h */
80 #  define HAS_popen_close 1 /* popen(); pclose() */
81 #  define HAS_sopen     4   /* sopen() : in io.h, 4 parameters */
82 
83 #  define HAS_DOS_H     1  /* use "#include <dos.h>" for _int86 () etc. */
84 #  define HAS_DIRENT_H  1  /* use "#include <dirent.h>" for opendir() etc. */
85 #  define HAS_IO_H      1  /* use "#include <io.h>" */
86 #  define HAS_SHARE_H   1  /* may use "#include <share.h> */
87 #  define HAS_UNISTD_H  1  /* use "#include <unistd.h> */
88 #  define HAS_SIGNAL_H  1  /* <signal.h> */
89 #  define HAS_PROCESS_H 1  /* may use "#include <process.h> */
90 #  define HAS_PWD_H
91 #  define HAS_UTIME_H   1
92 
93 #  define USE_STAT_MACROS
94 
95 #  ifndef LONG_MAX
96 #    include <limits.h>
97 #  endif
98 
99 
100 typedef unsigned bit;
101 
102 typedef unsigned char byte;
103 typedef signed char sbyte;
104 
105 typedef unsigned short word;
106 typedef signed short sword;
107 
108 typedef unsigned long dword;
109 typedef signed long sdword;
110 
111 typedef signed short sshort;
112 //typedef unsigned short ushort;
113 
114 typedef signed long slong;
115 typedef unsigned long ulong;
116 
117 
118 typedef   signed char        hCHAR;              /*  1 byte */
119 typedef   signed char       hSCHAR;              /*  1 byte */
120 typedef unsigned char       hUCHAR;              /*  1 byte */
121 
122 typedef   signed char        hINT8;              /*  1 byte */
123 typedef   signed char       hSINT8;              /*  1 byte */
124 typedef unsigned char       hUINT8;              /*  1 byte */
125 
126 typedef   signed short      hINT16;              /*  2 bytes */
127 typedef   signed short     hSINT16;              /*  2 bytes */
128 typedef unsigned short     hUINT16;              /*  2 bytes */
129 
130 typedef   signed int        hINT32;              /*  4 bytes */
131 typedef   signed int       hSINT32;              /*  4 bytes */
132 typedef unsigned int       hUINT32;              /*  4 bytes */
133 
134 /* Not all GCC support this, test please (Stas Degteff) */
135 typedef   signed long long  hINT64;              /*  8 bytes */
136 typedef   signed long long hSINT64;              /*  8 bytes */
137 typedef unsigned long long hUINT64;              /*  8 bytes */
138 #define HAS_INT64
139 
140 #endif
141