mirror of https://github.com/OpenVPN/openvpn-gui
always compile a unicode binary
parent
a1c152d3af
commit
54d74f5861
|
@ -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 \
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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')
|
||||
|
|
Loading…
Reference in New Issue