always compile a unicode binary

pull/1/head
Heiko Hund 13 years ago
parent a1c152d3af
commit 54d74f5861

@ -7,7 +7,7 @@ WINDRES = @WINDRES@
LDFLAGS = @CRYPTO_LDFLAGS@ @LDFLAGS@ LDFLAGS = @CRYPTO_LDFLAGS@ @LDFLAGS@
LIBS = @CRYPTO_LIBS@ @LIBS@ LIBS = @CRYPTO_LIBS@ @LIBS@
CFLAGS = @CRYPTO_CPPFLAGS@ @CFLAGS@ @CPPFLAGS@ CFLAGS = @CRYPTO_CPPFLAGS@ @CFLAGS@ @CPPFLAGS@ -DUNICODE -D_UNICODE
CFLAGS += -W -Wall -Wno-unused-parameter -pedantic CFLAGS += -W -Wall -Wno-unused-parameter -pedantic
OBJS = main.o tray.o openvpn.o viewlog.o \ OBJS = main.o tray.o openvpn.o viewlog.o \

@ -19,11 +19,6 @@ AC_DEFINE(PACKAGE_RELEASE, [RELEASE],
AC_PROG_CC_C99 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 AC_CANONICAL_HOST
case $host in case $host in
*-cygwin) *-cygwin)

@ -131,12 +131,7 @@ LoadStringLang(UINT stringId, LANGID langId, PTSTR buffer, int bufferSize, va_li
break; break;
formatStr[*entry] = 0; formatStr[*entry] = 0;
#ifdef _UNICODE
wcsncpy(formatStr, entry + 1, *entry); wcsncpy(formatStr, entry + 1, *entry);
#else
WideCharToMultiByte(CP_ACP, 0, entry + 1, *entry, formatStr, *entry, "?", NULL);
#endif
_vsntprintf(buffer, bufferSize, formatStr, args); _vsntprintf(buffer, bufferSize, formatStr, args);
buffer[bufferSize - 1] = 0; buffer[bufferSize - 1] = 0;
free(formatStr); free(formatStr);

@ -153,12 +153,8 @@ OnStateChange(connection_t *c, char *data)
if (pos != NULL) if (pos != NULL)
*pos = '\0'; *pos = '\0';
#ifdef _UNICODE
/* Convert the IP address to Unicode */ /* Convert the IP address to Unicode */
MultiByteToWideChar(CP_ACP, 0, local_ip, -1, c->ip, _tsizeof(c->ip)); 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 */ /* Show connection tray balloon */
if ((c->state == connecting && o.show_balloon[0] != '0') if ((c->state == connecting && o.show_balloon[0] != '0')

Loading…
Cancel
Save