Introduce symbol USE_WINSOCK which will be defined when
authorYang Tse <yangsita@gmail.com>
Wed, 18 Oct 2006 15:57:49 +0000 (15:57 +0000)
committerYang Tse <yangsita@gmail.com>
Wed, 18 Oct 2006 15:57:49 +0000 (15:57 +0000)
using winsock or winsock2 API.

setup.h

diff --git a/setup.h b/setup.h
index 70af3be3c39de665d20a4630ffb96ea0ac5d4305..3b97e273eba5e1fc99e8e88ed19838c131f9a333 100644 (file)
--- a/setup.h
+++ b/setup.h
 #  endif
 #endif
 
+/*
+ * Define USE_WINSOCK to 2 if we have and use WINSOCK2 API, else
+ * define USE_WINSOCK to 1 if we have and use WINSOCK  API, else
+ * undefine USE_WINSOCK.
+ */
+
+#undef USE_WINSOCK
+
+#ifdef HAVE_WINSOCK2_H
+#  define USE_WINSOCK 2
+#else
+#  ifdef HAVE_WINSOCK_H
+#    define USE_WINSOCK 1
+#  endif
+#endif
+
 /*
  * Work-arounds for systems without configure support
  */