diff --git a/configure.ac b/configure.ac index 1552bb39..ca8c6d81 100644 --- a/configure.ac +++ b/configure.ac @@ -1147,8 +1147,8 @@ AC_SUBST(INSTALL_STUBBY) AC_SUBST(UNINSTALL_STUBBY) AC_SUBST(STUBBY_XTRA_OBJS) -STUBBY_LDFLAGS="" STUBBY_LIBS="" +STUBBY_LDFLAGS="" if test $my_with_yaml = 1 then @@ -1156,8 +1156,8 @@ then then getdns_LIBS="$LIBS" getdns_LDFLAGS="$LDFLAGS" - LIBS="" - LDFLAGS="" + LIBS="$initial_LIBS" + LDFLAGS="$initial_LDFLAGS" fi AC_ARG_WITH(libyaml, AS_HELP_STRING([--with-libyaml=pathname], [path to libyaml (default: search /usr/local ..)]), @@ -1350,7 +1350,44 @@ AH_BOTTOM([ # ifndef FD_SETSIZE # define FD_SETSIZE 1024 # endif -# define PRIsz "Iu" + +/* the version of the windows API enabled */ +# ifndef WINVER +# define WINVER 0x0600 // 0x0502 +# endif +# ifndef _WIN32_WINNT +# define _WIN32_WINNT 0x0600 // 0x0502 +# endif +# ifdef HAVE_WS2TCPIP_H +# include +# endif + +# ifdef _MSC_VER +# if _MSC_VER >= 1800 +# define PRIsz "zu" +# else +# define PRIsz "Iu" +# endif +# else +# define PRIsz "Iu" +# endif + +# ifdef HAVE_WINSOCK2_H +# include +# endif + +# ifndef USE_WINSOCK +# define ARG_LL "%ll" +# else +# define ARG_LL "%I64" +# endif + +/* detect if we need to cast to unsigned int for FD_SET to avoid warnings */ +# ifdef HAVE_WINSOCK2_H +# define FD_SET_T (u_int) +# else +# define FD_SET_T +# endif /* Windows wants us to use _strdup instead of strdup */ # ifndef strdup @@ -1366,34 +1403,6 @@ AH_BOTTOM([ #include #include -/* the version of the windows API enabled */ -#ifndef WINVER -#define WINVER 0x0600 // 0x0502 -#endif -#ifndef _WIN32_WINNT -#define _WIN32_WINNT 0x0600 // 0x0502 -#endif -#ifdef HAVE_WINSOCK2_H -#include -#endif - -#ifdef HAVE_WS2TCPIP_H -#include -#endif - -#ifndef USE_WINSOCK -#define ARG_LL "%ll" -#else -#define ARG_LL "%I64" -#endif - -/* detect if we need to cast to unsigned int for FD_SET to avoid warnings */ -#ifdef HAVE_WINSOCK2_H -#define FD_SET_T (u_int) -#else -#define FD_SET_T -#endif - #ifdef __cplusplus extern "C" { #endif diff --git a/src/convert.c b/src/convert.c index d6289ecf..71f25491 100644 --- a/src/convert.c +++ b/src/convert.c @@ -32,10 +32,10 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "config.h" #include #include #include -#include "config.h" #ifndef USE_WINSOCK #include #endif diff --git a/src/dict.c b/src/dict.c index d6986788..99e347ad 100644 --- a/src/dict.c +++ b/src/dict.c @@ -34,8 +34,8 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include #include "config.h" +#include #ifndef USE_WINSOCK #include #include