From: Heiko Hund Date: Thu, 16 Feb 2012 17:30:38 +0000 (+0100) Subject: replace check for TARGET_WIN32 with WIN32 X-Git-Tag: v2.3-alpha1~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=76a3c405549bf02902846a9bd0e7d0f3a25a5b4d;p=thirdparty%2Fopenvpn.git replace check for TARGET_WIN32 with WIN32 Use of TARGET_WIN32 breaks MSVC builds as it is only defined for mingw builds done with the autotools buildsystem. Signed-off-by: Heiko Hund Acked-by: Gert Doering Signed-off-by: David Sommerseth --- diff --git a/misc.c b/misc.c index 58096fae3..a07780fce 100644 --- a/misc.c +++ b/misc.c @@ -356,7 +356,7 @@ int openvpn_chdir (const char* dir) { #ifdef HAVE_CHDIR -#ifdef TARGET_WIN32 +#ifdef WIN32 int res; struct gc_arena gc = gc_new (); res = _wchdir (wide_string (dir, &gc)); @@ -598,7 +598,7 @@ openvpn_system (const char *command, const struct env_set *es, unsigned int flag /* * execute the command */ -#ifdef TARGET_WIN32 +#ifdef WIN32 gc = gc_new (); ret = _wsystem (wide_string (command, &gc)); gc_free (&gc); @@ -627,7 +627,7 @@ openvpn_system (const char *command, const struct env_set *es, unsigned int flag int openvpn_access (const char *path, int mode) { -#ifdef TARGET_WIN32 +#ifdef WIN32 struct gc_arena gc = gc_new (); int ret = _waccess (wide_string (path, &gc), mode); gc_free (&gc); diff --git a/misc.h b/misc.h index 2413f53c2..8c0bae169 100644 --- a/misc.h +++ b/misc.h @@ -147,7 +147,7 @@ openvpn_run_script (const struct argv *a, const struct env_set *es, const unsign return openvpn_execve_check(a, es, flags | S_SCRIPT, msg); }; -#ifdef TARGET_WIN32 +#ifdef WIN32 FILE * openvpn_fopen (const char *path, const char *mode); #else static inline FILE * @@ -157,7 +157,7 @@ openvpn_fopen (const char *path, const char *mode) } #endif -#ifdef TARGET_WIN32 +#ifdef WIN32 int openvpn_open (const char *path, int flags, mode_t mode); #else static inline int @@ -167,7 +167,7 @@ openvpn_open (const char *path, int flags, mode_t mode) } #endif -#ifdef TARGET_WIN32 +#ifdef WIN32 int openvpn_stat (const char *path, struct stat *buf); #else static inline int diff --git a/openvpn.c b/openvpn.c index 84289d22b..b2175a19f 100644 --- a/openvpn.c +++ b/openvpn.c @@ -131,7 +131,7 @@ main (int argc, char *argv[]) return 1; #endif -#ifdef TARGET_WIN32 +#ifdef WIN32 SetConsoleOutputCP (CP_UTF8); #endif