#ifndef CYGUTILS_COMMON_H
#define CYGUTILS_COMMON_H 1
+#if defined(_WIN32) || defined(__WIN32) || defined(WIN32) || defined(__WIN32__)
+# ifndef WIN32
+# define WIN32 1
+# endif
+# ifndef _WIN32
+# define _WIN32 1
+# endif
+# ifndef __WIN32
+# define __WIN32 1
+# endif
+# ifndef __WIN32__
+# define __WIN32__ 1
+# endif
+#endif
+
#if HAVE_CONFIG_H
# include <config.h>
#endif
#if HAVE_MALLOC_H
# include <malloc.h>
-#endif /*HAVE_LIMITS_H*/
+#endif /*HAVE_MALLOC_H*/
-/* Geez, last.c/utmpdump.c have a lot of special requirements */
#if HAVE_CTYPE_H
# include <ctype.h>
-#endif
+#endif /*HAVE_CTYPE_H*/
+
#if HAVE_GETOPT_H
# include <getopt.h>
+#endif /*HAVE_GETOPT_H*/
+
+/* column needs TIOCGWINSZ */
+#if HAVE_TERMIOS_H
+# include <termios.h>
#endif
-#if HAVE_UTMP_H
-# include <utmp.h>
-#endif /* HAVE_UTMP_H */
-#if HAVE_SIGNAL_H
-# include <signal.h>
-#endif /* HAVE_SIGNAL_H */
-#if HAVE_NETINET_IN_H
-# include <netinet/in.h>
-#endif /* HAVE_NETINET_IN_H */
-#if HAVE_NETDB_H
-# include <netdb.h>
-#endif /* HAVE_NETDB_H */
-#if HAVE_ARPA_INET_H
-# include <arpa/inet.h>
-#endif /* HAVE_ARPA_INET_H */
-#if HAVE_SYS_SOCKET_H
-# include <sys/socket.h>
-#endif /* HAVE_SYS_SOCKET_H */
-/* End: last.c/utmpdump.c stuff */
+
+#if GWINSZ_IN_SYS_IOCTL
+# include <sys/ioctl.h>
+#endif
+/* End: column needs TIOCGWINSZ */
+
#if HAVE_POPT_H
# include <popt.h>