1 /* $Id$
2  *  Microsoft C 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 /* Microsoft C or Microsoft QuickC for MS-DOS or OS/2 */
28 
29 #ifndef HUSKY_MSC_H
30 #define HUSKY_MSC_H
31 
32 #ifndef _MSC_VER
33 #  error This file used only with Microsoft C or Microsoft QuickC for MS-DOS or OS/2 !
34 #endif
35 
36 #  ifndef __LITTLE_ENDIAN__
37 #    define __LITTLE_ENDIAN__
38 #  endif
39 
40 #  define _stdc cdecl
41 #  define _intr cdecl interrupt far
42 #  define _intcast void (_intr *)()
43 #  define _veccast _intcast
44 
45 #  if _MSC_VER >= 600
46 #    define _fast _fastcall
47 #  else
48 #    define _fast pascal
49 #  endif
50 
51 #  define farmalloc(n)    _fmalloc(n)
52 #  define farfree(p)      _ffree(p)
53 #  define farrealloc(p,n) _frealloc(p,n)
54 
55 #  if _MSC_VER >= 600
56 #    define farcalloc(a,b) _fcalloc(a,b)
57 #  else
58      void far *farcalloc(int n, int m);
59 #  endif
60 
61 #  ifdef __OS2__
62     /* just don't use 16 bit OS/2, we doubt that it still works */
63 #    define farread read
64 #    define farwrite write
65 #    define _XPENTRY pascal far
66 #    define mysleep(x) DosSleep(1000L*(x))
67 #    define sleep(x) DosSleep(1000L*(x))
68 #    define HAS_sleep     1
69 #  else
70 #    define _XPENTRY
71 #    define mymkdir(x) _mkdir(x)
72 #  endif
73 
74 #  define HAS_MALLOC_H  1  /* use "#include <malloc.h>" for malloc() etc. */
75 #  define HAS_IO_H      1  /* may use "#include <io.h> */
76 #  define HAS_SHARE_H   1  /* may use "#include <share.h> */
77 #  define HAS_PROCESS_H 1  /* may use "#include <process.h> */
78 #  define HAS_DOS_H     1  /* definitions for MS-DOS interface routines */
79 #  define HAS_DIRECT_H  1  /* function declarations for directory handling/creation */
80 #  define HAS_SYS_UTIME_H 1 /* definitions/declarations for utime() */
81 
82 #  define USE_STAT_MACROS
83 
84 
85 typedef unsigned bit;
86 
87 typedef unsigned char byte;
88 typedef signed char sbyte;
89 
90 typedef unsigned short word;
91 typedef signed short sword;
92 
93 typedef unsigned long dword;
94 typedef signed long sdword;
95 
96 typedef signed short sshort;
97 typedef unsigned short ushort;
98 
99 typedef signed long slong;
100 typedef unsigned long ulong;
101 
102 
103 typedef   signed char        hCHAR;              /*  1 byte */
104 typedef   signed char       hSCHAR;              /*  1 byte */
105 typedef unsigned char       hUCHAR;              /*  1 byte */
106 
107 typedef   signed char        hINT8;              /*  1 byte */
108 typedef   signed char       hSINT8;              /*  1 byte */
109 typedef unsigned char       hUINT8;              /*  1 byte */
110 
111 typedef   signed short      hINT16;              /*  2 bytes */
112 typedef   signed short     hSINT16;              /*  2 bytes */
113 typedef unsigned short     hUINT16;              /*  2 bytes */
114 
115 typedef   signed long       hINT32;              /*  4 bytes */
116 typedef   signed long      hSINT32;              /*  4 bytes */
117 typedef unsigned long      hUINT32;              /*  4 bytes */
118 
119 #endif
120