Skip to content

Commit

Permalink
always compile a unicode binary
Browse files Browse the repository at this point in the history
  • Loading branch information
d12fk committed Aug 29, 2011
1 parent a1c152d commit 54d74f5
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 15 deletions.
2 changes: 1 addition & 1 deletion Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
5 changes: 0 additions & 5 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 0 additions & 5 deletions localization.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 0 additions & 4 deletions openvpn.c
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 54d74f5

Please sign in to comment.