1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2024-11-23 01:49:53 +03:00

musl support

Internat.c: fix iconv() with musl by removing unrecognized EUCJP encoding
src/CMakeFiles.txt: recognize USE_MUSL=YES environment variable to compile with musl
This commit is contained in:
thepyper 2018-08-08 16:02:20 +02:00
parent d65f292888
commit 3b4e8fd9fa
2 changed files with 6 additions and 3 deletions

View File

@ -43,6 +43,9 @@ if(UNIX)
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
add_definitions(-DUNIX_LINUX)
if($ENV{USE_MUSL} STREQUAL "YES")
add_definitions(-DUNIX_LINUX_MUSL)
endif()
endif()
if(${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")

View File

@ -789,11 +789,11 @@ void InitInternational()
d = IconvWideToStrInternal();
if (d == (void *)-1)
{
#ifdef UNIX_MACOS
#if defined (UNIX_MACOS) || defined (UNIX_LINUX_MUSL)
StrCpy(charset, sizeof(charset), "utf-8");
#else // UNIX_MACOS
#else // defined (UNIX_MACOS) || defined (UNIX_LINUX_MUSL)
StrCpy(charset, sizeof(charset), "EUCJP");
#endif // UNIX_MACOS
#endif // defined (UNIX_MACOS) || defined (UNIX_LINUX_MUSL)
d = IconvWideToStrInternal();
if (d == (void *)-1)
{