From 54d74f58615e6d26bef0bb81f3203d0cff9f7ab3 Mon Sep 17 00:00:00 2001 From: Heiko Hund Date: Mon, 29 Aug 2011 13:56:32 +0000 Subject: [PATCH] always compile a unicode binary --- Makefile.in | 2 +- configure.ac | 5 ----- localization.c | 5 ----- openvpn.c | 4 ---- 4 files changed, 1 insertion(+), 15 deletions(-) diff --git a/Makefile.in b/Makefile.in index d8654e1..7cb8cf1 100644 --- a/Makefile.in +++ b/Makefile.in @@ -7,7 +7,7 @@ WINDRES = @WINDRES@ LDFLAGS = @CRYPTO_LDFLAGS@ @LDFLAGS@ LIBS = @CRYPTO_LIBS@ @LIBS@ -CFLAGS = @CRYPTO_CPPFLAGS@ @CFLAGS@ @CPPFLAGS@ +CFLAGS = @CRYPTO_CPPFLAGS@ @CFLAGS@ @CPPFLAGS@ -DUNICODE -D_UNICODE CFLAGS += -W -Wall -Wno-unused-parameter -pedantic OBJS = main.o tray.o openvpn.o viewlog.o \ diff --git a/configure.ac b/configure.ac index 56da927..a3521cb 100644 --- a/configure.ac +++ b/configure.ac @@ -19,11 +19,6 @@ AC_DEFINE(PACKAGE_RELEASE, [RELEASE], AC_PROG_CC_C99 -AC_ARG_ENABLE([unicode], - AS_HELP_STRING([--disable-unicode], - [produce a binary without Unicode support]), [], - [CPPFLAGS="$CPPFLAGS -DUNICODE -D_UNICODE"]) - AC_CANONICAL_HOST case $host in *-cygwin) diff --git a/localization.c b/localization.c index b089d13..8e86b50 100644 --- a/localization.c +++ b/localization.c @@ -131,12 +131,7 @@ LoadStringLang(UINT stringId, LANGID langId, PTSTR buffer, int bufferSize, va_li break; formatStr[*entry] = 0; -#ifdef _UNICODE wcsncpy(formatStr, entry + 1, *entry); -#else - WideCharToMultiByte(CP_ACP, 0, entry + 1, *entry, formatStr, *entry, "?", NULL); -#endif - _vsntprintf(buffer, bufferSize, formatStr, args); buffer[bufferSize - 1] = 0; free(formatStr); diff --git a/openvpn.c b/openvpn.c index f9392f2..47bb245 100644 --- a/openvpn.c +++ b/openvpn.c @@ -153,12 +153,8 @@ OnStateChange(connection_t *c, char *data) if (pos != NULL) *pos = '\0'; -#ifdef _UNICODE /* Convert the IP address to Unicode */ MultiByteToWideChar(CP_ACP, 0, local_ip, -1, c->ip, _tsizeof(c->ip)); -#else - strncpy(c->ip, local_ip, sizeof(c->ip)); -#endif /* Show connection tray balloon */ if ((c->state == connecting && o.show_balloon[0] != '0')