summaryrefslogtreecommitdiffstats
path: root/Utilities
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2012-01-04 13:46:49 (GMT)
committerBrad King <brad.king@kitware.com>2012-01-04 13:46:49 (GMT)
commitf293b73d71c5dbbf053a864b2c2f285ef0834630 (patch)
tree8de53fdb4b87a59a25b5934dc800a1a60a4b0ce6 /Utilities
parent6781a099406d7864f21ccbbf11c1995f8700b159 (diff)
downloadCMake-f293b73d71c5dbbf053a864b2c2f285ef0834630.zip
CMake-f293b73d71c5dbbf053a864b2c2f285ef0834630.tar.gz
CMake-f293b73d71c5dbbf053a864b2c2f285ef0834630.tar.bz2
libarchive: Define _XOPEN_SOURCE=500 on HP-UX
The HP-UX <wchar.h> header provides 'mbstate_t' in C89/C90 mode only if _XOPEN_SOURCE is defined to exactly 500. Type 'mbstate_t' was introduced in C89/C90 Normative Amendment 1, aka C94/C95, adding support international character sets. It is part of C99 but not C89/C90.
Diffstat (limited to 'Utilities')
-rw-r--r--Utilities/cmlibarchive/CMakeLists.txt4
1 files changed, 4 insertions, 0 deletions
diff --git a/Utilities/cmlibarchive/CMakeLists.txt b/Utilities/cmlibarchive/CMakeLists.txt
index 9689b28..2352693 100644
--- a/Utilities/cmlibarchive/CMakeLists.txt
+++ b/Utilities/cmlibarchive/CMakeLists.txt
@@ -75,6 +75,10 @@ IF(WIN32)
SET(_WIN32_WINNT ${WINVER})
ENDIF(WIN32)
+IF("${CMAKE_C_PLATFORM_ID}" MATCHES "^(HP-UX)$")
+ ADD_DEFINITIONS(-D_XOPEN_SOURCE=500) # Ask wchar.h for mbstate_t
+ENDIF()
+
#
INCLUDE(CheckCSourceCompiles)
INCLUDE(CheckCSourceRuns)