summaryrefslogtreecommitdiff
path: root/src/pal
diff options
context:
space:
mode:
Diffstat (limited to 'src/pal')
-rw-r--r--src/pal/src/configure.cmake3
-rw-r--r--src/pal/src/locale/unicode.cpp18
2 files changed, 11 insertions, 10 deletions
diff --git a/src/pal/src/configure.cmake b/src/pal/src/configure.cmake
index 86b5d945b3..d1c7506375 100644
--- a/src/pal/src/configure.cmake
+++ b/src/pal/src/configure.cmake
@@ -38,6 +38,7 @@ check_include_files(sys/prctl.h HAVE_PRCTL_H)
check_include_files(numa.h HAVE_NUMA_H)
check_include_files(pthread_np.h HAVE_PTHREAD_NP_H)
check_include_files("sys/auxv.h;asm/hwcap.h" HAVE_AUXV_HWCAP_H)
+check_include_files("libintl.h" HAVE_LIBINTL_H)
if(NOT CMAKE_SYSTEM_NAME STREQUAL FreeBSD AND NOT CMAKE_SYSTEM_NAME STREQUAL NetBSD)
set(CMAKE_REQUIRED_FLAGS "-ldl")
@@ -421,7 +422,7 @@ int main()
exit(ret);
}" HAVE_CLOCK_MONOTONIC)
-check_library_exists(pthread pthread_condattr_setclock "" HAVE_PTHREAD_CONDATTR_SETCLOCK)
+check_library_exists(${PTHREAD_LIBRARY} pthread_condattr_setclock "" HAVE_PTHREAD_CONDATTR_SETCLOCK)
check_cxx_source_runs("
#include <stdlib.h>
diff --git a/src/pal/src/locale/unicode.cpp b/src/pal/src/locale/unicode.cpp
index 97d4731198..c9c1ae1c4d 100644
--- a/src/pal/src/locale/unicode.cpp
+++ b/src/pal/src/locale/unicode.cpp
@@ -37,9 +37,9 @@ Revision History:
#include <pthread.h>
#include <locale.h>
-#ifndef __APPLE__
+#if HAVE_LIBINTL_H
#include <libintl.h>
-#endif // __APPLE__
+#endif // HAVE_LIBINTL_H
#include <errno.h>
#if HAVE_COREFOUNDATION
#include <CoreFoundation/CoreFoundation.h>
@@ -915,7 +915,7 @@ BOOL
PALAPI
PAL_BindResources(IN LPCSTR lpDomain)
{
-#ifndef __APPLE__
+#if HAVE_LIBINTL_H
_ASSERTE(g_szCoreCLRPath != NULL);
char * coreCLRDirectoryPath;
PathCharString coreCLRDirectoryPathPS;
@@ -931,10 +931,10 @@ PAL_BindResources(IN LPCSTR lpDomain)
LPCSTR boundPath = bindtextdomain(lpDomain, coreCLRDirectoryPath);
return boundPath != NULL;
-#else // __APPLE__
- // UNIXTODO: Implement for OSX if necessary
+#else // HAVE_LIBINTL_H
+ // UNIXTODO: Implement for Unixes without libintl if necessary
return TRUE;
-#endif // __APPLE__
+#endif // HAVE_LIBINTL_H
}
/*++
@@ -955,16 +955,16 @@ PAL_GetResourceString(
IN int cchWideChar
)
{
-#ifndef __APPLE__
+#if HAVE_LIBINTL_H
// NOTE: dgettext returns the key if it fails to locate the appropriate
// resource. In our case, that will be the English string.
LPCSTR resourceString = dgettext(lpDomain, lpResourceStr);
-#else // __APPLE__
+#else // HAVE_LIBINTL_H
// UNIXTODO: Implement for OSX using the native localization API
// This is a temporary solution until we add the real native resource support.
LPCSTR resourceString = lpResourceStr;
-#endif // __APPLE__
+#endif // HAVE_LIBINTL_H
int length = strlen(resourceString);
return UTF8ToUnicode(lpResourceStr, length + 1, lpWideCharStr, cchWideChar, 0);