--- tcpdump-stdinc.h.org  Mon Aug  5 07:47:24 2002
+++ tcpdump-stdinc.h      Sat Mar  1 15:14:58 2003
@@ -28,16 +28,22 @@
  * differences to this one file.
  */
 
+#ifndef tcpdump_stdinc_h
+#define tcpdump_stdinc_h
+
 #ifdef WIN32
 
+#include <stdio.h>
 #include <winsock2.h>
 #include "bittypes.h"
+#include <ctype.h>
 #include <time.h>
 #include <io.h>
 #include "IP6_misc.h"
 #include <fcntl.h>
 
 #ifdef __MINGW32__
+#include <stdint.h>
 int* _errno();
 #define errno (*_errno())
 
@@ -46,6 +52,10 @@
 
 #endif /* __MINGW32__ */
 
+#ifndef toascii
+#define toascii(c) ((c) & 0x7f)
+#endif
+
 #ifndef caddr_t
 typedef char* caddr_t;
 #endif /* caddr_t */
@@ -57,7 +67,8 @@
 #define vsnprintf _vsnprintf
 #define RETSIGTYPE void
 
-#ifndef __MINGW32__
+#if !defined(__MINGW32__) && !defined(__WATCOMC__)
+#undef toascii
 #define isascii __isascii
 #define toascii __toascii
 #define stat _stat
@@ -91,3 +102,17 @@
 #ifdef INET6
 #include "ip6.h"
 #endif
+
+#if defined(WIN32) || defined(MSDOS)
+  #define FOPEN_READ_TXT   "rt"
+  #define FOPEN_READ_BIN   "rb"
+  #define FOPEN_WRITE_TXT  "wt"
+  #define FOPEN_WRITE_BIN  "wb"
+#else
+  #define FOPEN_READ_TXT   "r"
+  #define FOPEN_READ_BIN   FOPEN_READ_BIN
+  #define FOPEN_WRITE_TXT  "w"
+  #define FOPEN_WRITE_BIN  FOPEN_WRITE_TXT
+#endif
+
+#endif /* tcpdump_stdinc_h */
