Il 29.02.2012 22:11, Alon Bar-Lev ha scritto:
> Signed-off-by: Alon Bar-Lev <alon.bar...@gmail.com>
> ---
>  configure.ac    |    2 +-
>  syshead.h       |    4 ----
>  win/msvc.mak.in |    2 +-
>  3 files changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index 1c4d66c..aa1d509 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -342,7 +342,7 @@ case "$host" in
>       ;;
>  *-mingw*)
>       AC_DEFINE(TARGET_WIN32, 1, [Are we running WIN32?])
> -     CPPFLAGS="${CPPFLAGS} -DWIN32_LEAN_AND_MEAN"
> +     CPPFLAGS="${CPPFLAGS} -DWIN32_LEAN_AND_MEAN -DWINVER=0x0501"
>       OPENVPN_ADD_LIBS(-lgdi32)
>       OPENVPN_ADD_LIBS(-lws2_32)
>       OPENVPN_ADD_LIBS(-lwininet)
> diff --git a/syshead.h b/syshead.h
> index 0235abd..e8e70d2 100644
> --- a/syshead.h
> +++ b/syshead.h
> @@ -28,10 +28,6 @@
>  /*
>   * Only include if not during configure
>   */
> -#ifdef WIN32
> -/* PF_INET6: win32 ipv6 exists only after 0x0501 (XP) */
> -#define WINVER 0x0501
> -#endif
>  #ifndef PACKAGE_NAME
>  #include "config.h"
>  #include "compat.h"
> diff --git a/win/msvc.mak.in b/win/msvc.mak.in
> index 191f370..43c3335 100644
> --- a/win/msvc.mak.in
> +++ b/win/msvc.mak.in
> @@ -38,7 +38,7 @@ LIB_DIRS = -LIBPATH:$(OPENSSL)\lib 
> -LIBPATH:$(POLARSSL)\build\library -LIBPATH:$
>  EXE = openvpn.exe
>  
>  CPP=cl.exe
> -CPP_ARG_COMMON=/nologo /W3 -DWIN32 -DWIN32_LEAN_AND_MEAN -D_CONSOLE -D_MBCS 
> -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS 
> -D_CRT_SECURE_NO_WARNINGS $(INCLUDE_DIRS) /FD /c
> +CPP_ARG_COMMON=/nologo /W3 -DWIN32 -DWIN32_LEAN_AND_MEAN -DWINVER=0x0501 
> -D_CONSOLE -D_MBCS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS 
> -D_CRT_SECURE_NO_WARNINGS $(INCLUDE_DIRS) /FD /c
>  
>  LINK32=link.exe
>  

Makes sense. WINVER defines the minimum supported Windows version[1]. In
this case (0x501) we support WIndows XP and later. Making this a
buildsystem option makes perfect sense to me - editing the header files
to determine which Windows version will be supported seems silly.

ACK.

-- 
Samuli Seppänen
Community Manager
OpenVPN Technologies, Inc

irc freenode net: mattock


[1]
<http://blogs.msdn.com/b/dsvc/archive/2009/06/19/troubleshooting-not-a-valid-win32-application-error-at-the-startup.aspx>

Reply via email to