1 /* $Id$ 2 * Watcom C compiler-specific declarations for any platform 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 /* Watcom C/C++ all variants (DOS-16, DOS-32, Win, OS/2, QNX) */ 28 29 #ifndef HUSKY_WATCOMC_H 30 #define HUSKY_WATCOMC_H 31 32 #ifndef __WATCOMC__ 33 #error This file may be used only with Watcom C ! 34 #endif 35 36 37 # define mode_t int 38 39 #if ( __WATCOMC__ > 1000 ) 40 /* Watcom C 10.0 */ 41 # define mktemp _mktemp 42 #endif 43 44 # define strcasecmp stricmp 45 # define strncasecmp strnicmp 46 # define snprintf _snprintf 47 # define vsnprintf _vsnprintf 48 # define HAS_snprintf 49 # define HAS_vsnprintf 50 # define HAS_spawnvp 51 # define HAS_getpid 52 # define HAS_strftime /* strftime() in time.h */ 53 # define HAS_mktime /* mktime() in time.h */ 54 # define HAS_mktemp 1 55 56 # define HAS_MALLOC_H /* may be used "#include <malloc.h>" (see alc.h) */ 57 # define HAS_IO_H /* may use "#include <io.h> */ 58 # define HAS_SHARE_H /* may use "#include <share.h> */ 59 # define HAS_DIRECT_H 60 # define HAS_SYS_UTIME_H /* #include <sys/utime.h> in alternate to <utime.h> */ 61 # define HAS_DOS_H 62 # define HAS_SIGNAL_H 1 /* <signal.h> */ 63 # define HAS_PROCESS_H /* may use "#include <process.h> */ 64 65 # define mymkdir(x) mkdir(x) /*<direct.h>*/ 66 # define HAS_mkdir 67 # include <dos.h> 68 # define mysleep(x) sleep(x) /* dos.h */ 69 # define HAS_sleep 70 71 # if defined(__WATCOMC__DOS4G__) /* WATCOM C/C++ for DOS4G */ 72 # include "WCX.h" 73 # elif defined(__WATCOMC__DOS__) /* WATCOM C/C++ for MS-DOS (16 bit)*/ 74 # include "WCD.h" 75 # elif defined(__WATCOMC__OS2__)/* WATCOM C/C++ for OS/2 */ 76 # include "WCO.h" 77 # elif defined(__WATCOMC__NT__) /* WATCOM C/C++ for Windows NT */ 78 # include "WCW.h" 79 # endif 80 81 82 typedef unsigned bit; 83 84 typedef unsigned char byte; 85 typedef signed char sbyte; 86 87 typedef unsigned short word; 88 typedef signed short sword; 89 90 #ifdef __ALPHA__ /* add other 64 bit systems here */ 91 typedef unsigned int dword; 92 typedef signed int sdword; 93 #else /* 32 and 16 bit machines */ 94 typedef unsigned long dword; 95 typedef signed long sdword; 96 #endif 97 98 typedef signed short sshort; 99 typedef unsigned short ushort; 100 101 typedef signed long slong; 102 typedef unsigned long ulong; 103 104 105 106 typedef signed char hCHAR; /* 1 byte */ 107 typedef signed char hSCHAR; /* 1 byte */ 108 typedef unsigned char hUCHAR; /* 1 byte */ 109 110 typedef signed char hINT8; /* 1 byte */ 111 typedef signed char hSINT8; /* 1 byte */ 112 typedef unsigned char hUINT8; /* 1 byte */ 113 114 typedef signed short hINT16; /* 2 bytes */ 115 typedef signed short hSINT16; /* 2 bytes */ 116 typedef unsigned short hUINT16; /* 2 bytes */ 117 118 #ifdef __ALPHA__ /* add other 64 bit systems here */ 119 typedef signed int hINT32; /* 4 bytes */ 120 typedef signed int hSINT32; /* 4 bytes */ 121 typedef unsigned int hUINT32; /* 4 bytes */ 122 #else 123 typedef signed long hINT32; /* 4 bytes */ 124 typedef signed long hSINT32; /* 4 bytes */ 125 typedef unsigned long hUINT32; /* 4 bytes */ 126 #endif 127 128 #if __WATCOMC__ >1000 129 typedef signed __int64 hINT64; /* 8 bytes */ 130 typedef signed __int64 hSINT64; /* 8 bytes */ 131 typedef unsigned __int64 hUINT64; /* 8 bytes */ 132 #define HAS_INT64 133 #endif 134 135 #endif 136