1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

w32: Almost everywhere include winsock2.h before windows.h.

--

This is required by newer mingw toolchain versions which demand that
winsock2.h is included before windows.h.  Now, due to the use of
socket definitions in pth.h we need to include winsock2.h also in
pth.h, now pth.h is often included after an include of windows.h and
thus the compiler spits out a warning.  To avoid that we include
winsock2.h at all places the compiler complains about.
This commit is contained in:
Werner Koch 2013-04-23 18:06:46 +02:00
parent a557a74615
commit 40ca0022a7
20 changed files with 436 additions and 380 deletions

View File

@ -38,7 +38,10 @@
#include <fcntl.h> /* for setmode() */
#endif
#ifdef HAVE_W32_SYSTEM
#include <windows.h> /* To initialize the sockets. fixme */
# ifdef HAVE_WINSOCK2_H
# include <winsock2.h>
# endif
# include <windows.h> /* To initialize the sockets. fixme */
#endif
#define JNLIB_NEED_LOG_LOGV

View File

@ -28,6 +28,9 @@
#include <unistd.h>
#include <sys/stat.h>
#ifdef HAVE_W32_SYSTEM
# ifdef HAVE_WINSOCK2_H
# include <winsock2.h>
# endif
# include <windows.h>
#else
# include <sys/times.h>

View File

@ -84,7 +84,7 @@ if test "$1" = "--build-w32"; then
fi
fi
./configure --enable-maintainer-mode --prefix=${w32root} \
$tsdir/configure --enable-maintainer-mode --prefix=${w32root} \
--host=${host} --build=${build} \
--enable-gpgtar \
--with-gpg-error-prefix=${w32root} \

View File

@ -79,6 +79,9 @@
#include <stddef.h>
#include <assert.h>
#ifdef HAVE_W32_SYSTEM
# ifdef HAVE_WINSOCK2_H
# include <winsock2.h>
# endif
# include <windows.h>
#endif
#ifdef HAVE_W32CE_SYSTEM

View File

@ -23,6 +23,9 @@
#include <fcntl.h>
#ifdef HAVE_W32_SYSTEM
# ifdef HAVE_WINSOCK2_H
# include <winsock2.h>
# endif
#include <shlobj.h>
#ifndef CSIDL_APPDATA
#define CSIDL_APPDATA 0x001a

View File

@ -46,6 +46,9 @@
#include <unistd.h>
#ifdef HAVE_W32_SYSTEM
# ifdef HAVE_WINSOCK2_H
# include <winsock2.h>
# endif
# include <windows.h>
#else /*!HAVE_W32_SYSTEM*/
# include <sys/types.h>

View File

@ -25,6 +25,9 @@
#endif
#ifdef HAVE_W32_SYSTEM
# ifdef HAVE_WINSOCK2_H
# include <winsock2.h>
# endif
#include <windows.h>
#endif
#ifdef HAVE_PTH

View File

@ -30,6 +30,9 @@
#include <fcntl.h>
#include <unistd.h>
#ifdef HAVE_W32_SYSTEM
# ifdef HAVE_WINSOCK2_H
# include <winsock2.h>
# endif
# include <windows.h>
#endif
#ifdef __riscos__

View File

@ -43,7 +43,12 @@
# include <sys/resource.h>
#endif
#ifdef HAVE_W32_SYSTEM
# ifndef WINVER
# define WINVER 0x0500 /* Required for AllowSetForegroundWindow. */
# endif
# ifdef HAVE_WINSOCK2_H
# include <winsock2.h>
# endif
# include <windows.h>
#endif
#ifdef HAVE_PTH

View File

@ -25,23 +25,26 @@
#include <stdarg.h>
#include <unistd.h>
#ifdef HAVE_TCGETATTR
#include <termios.h>
# include <termios.h>
#else
#ifdef HAVE_TERMIO_H
/* simulate termios with termio */
#include <termio.h>
#define termios termio
#define tcsetattr ioctl
#define TCSAFLUSH TCSETAF
#define tcgetattr(A,B) ioctl(A,TCGETA,B)
#define HAVE_TCGETATTR
#endif
# ifdef HAVE_TERMIO_H
/* Simulate termios with termio. */
# include <termio.h>
# define termios termio
# define tcsetattr ioctl
# define TCSAFLUSH TCSETAF
# define tcgetattr(A,B) ioctl(A,TCGETA,B)
# define HAVE_TCGETATTR
# endif
#endif
#ifdef _WIN32 /* use the odd Win32 functions */
#include <windows.h>
#ifdef HAVE_TCGETATTR
#error mingw32 and termios
#endif
# ifdef HAVE_WINSOCK2_H
# include <winsock2.h>
# endif
# include <windows.h>
# ifdef HAVE_TCGETATTR
# error mingw32 and termios
# endif
#endif
#include <errno.h>
#include <ctype.h>

View File

@ -33,7 +33,10 @@
#include <sys/wait.h>
#endif
#ifdef HAVE_DOSISH_SYSTEM
#include <windows.h>
# ifdef HAVE_WINSOCK2_H
# include <winsock2.h>
# endif
# include <windows.h>
#endif
#include <fcntl.h>
#include <unistd.h>

View File

@ -31,7 +31,10 @@
#endif
#include <fcntl.h>
#ifdef HAVE_W32_SYSTEM
#include <windows.h>
# ifdef HAVE_WINSOCK2_H
# include <winsock2.h>
# endif
# include <windows.h>
#endif
#define INCLUDED_BY_MAIN_MODULE 1

View File

@ -40,6 +40,9 @@
#ifdef HAVE_W32_SYSTEM
#include <time.h>
#include <process.h>
#ifdef HAVE_WINSOCK2_H
# include <winsock2.h>
#endif
#include <windows.h>
#include <shlobj.h>
#ifndef CSIDL_APPDATA

View File

@ -22,6 +22,9 @@
#include <stdio.h>
#include <string.h>
#ifdef _WIN32
# ifdef HAVE_WINSOCK2_H
# include <winsock2.h>
# endif
# include <windows.h>
# ifndef VER_PLATFORM_WIN32_WINDOWS
# define VER_PLATFORM_WIN32_WINDOWS 1

View File

@ -30,6 +30,9 @@
#include <unistd.h>
#include <sys/types.h>
#ifdef HAVE_W32_SYSTEM
# ifdef HAVE_WINSOCK2_H
# include <winsock2.h>
# endif
# include <windows.h>
#endif

View File

@ -32,6 +32,9 @@
#include <sys/stat.h>
#include <stdint.h>
#include <locale.h>
#ifdef HAVE_WINSOCK2_H
# include <winsock2.h>
#endif
#include <windows.h>
#ifdef JNLIB_IN_JNLIB

View File

@ -25,6 +25,9 @@
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#ifdef HAVE_WINSOCK2_H
# include <winsock2.h>
#endif
#include <windows.h>
#include "libjnlib-config.h"

View File

@ -28,7 +28,10 @@
#endif
#ifdef HAVE_W32_SYSTEM
#include <windows.h>
# ifdef HAVE_WINSOCK2_H
# include <winsock2.h>
# endif
# include <windows.h>
#else
#include <unistd.h>
#include <sys/types.h>

View File

@ -36,7 +36,10 @@
#include <stdlib.h>
#ifdef HAVE_W32_SYSTEM
#include <windows.h>
# ifdef HAVE_WINSOCK2_H
# include <winsock2.h>
# endif
# include <windows.h>
#endif
#ifdef HAVE_LIBCURL

View File

@ -82,7 +82,7 @@
#endif
#if defined(__APPLE__) || defined(_WIN32) || defined(__CYGWIN__)
typedef unsinged int pcsc_dword_t;
typedef unsigned int pcsc_dword_t;
#else
typedef unsigned long pcsc_dword_t;
#endif