]> git.pond.sub.org Git - empserver/commitdiff
Clean up w32misc.h, sysdep_w32.h not to override needlessly
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 18 Apr 2009 15:36:43 +0000 (17:36 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Mon, 30 Nov 2009 18:45:28 +0000 (19:45 +0100)
src/client/sysdep_w32.h
src/lib/w32/w32misc.h

index acb155f03c3737a61a0428d27a65d42abaf7b5eb..15b3afe1d83bfd8a7b6bbceb0a312aff2289b172 100644 (file)
@@ -34,6 +34,7 @@
 
 #ifndef _SYSDEF_W32_H
 #include <getopt.h>
+#include <stdio.h>
 #include <winsock2.h>
 #include <ws2tcpip.h>
 #include <windows.h>
@@ -78,7 +79,9 @@ extern void w32_sysdep_init(void);
 #define connect(sockfd, addr, addrlen) \
     w32_connect((sockfd), (addr), (addrlen))
 
+#ifdef _MSC_VER
 #define pclose _pclose
 #define popen _popen
 #define snprintf _snprintf
 #endif
+#endif
index 266b83def83502909d492c6cb901a0a63d434d99..55195538de4f3c58db7c71b08ea3f27f1b13b92e 100644 (file)
  *
  *  ---
  *
- *  w32misc.h: POSIX emulation for WIN32
- *     Stuff that can not be put in the equivalent include files
+ *  w32misc.h: POSIX emulation for WIN32, miscellaneous stuff
  *
  *  Known contributors to this file:
  *     Ron Koenderink, 2007
  */
 
+/*
+ * Stuff that cannot be put in the "correct" include files.  More of
+ * that in unistd.h.
+ */
+
 #ifndef W32MISC_H
 #define W32MISC_H
 
+#include <stddef.h>
+
 #ifdef _MSC_VER
 /* integral mismatch, due to misuse of sector short */
 #pragma warning (disable : 4761 )
 #endif
 
 /* stdio.h */
-#define vsnprintf _vsnprintf
+#ifdef _MSC_VER
 #define snprintf _snprintf
+#define vsnprintf _vsnprintf
+#endif
 
 /* stdlib.h */
-#include <io.h>
 extern char *initstate(unsigned seed, char *state, size_t size);
 extern long random(void);
 extern char *setstate(char *state);
 extern void srandom(unsigned seed);
 
 /* sys/types.h */
+#ifdef _MSC_VER
 typedef unsigned short mode_t;
 typedef long off_t;
 typedef int pid_t;
-#ifdef _MSC_VER
 typedef int __w64 ssize_t;
 #endif