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.
This commit is contained in:
Brad King 2012-01-04 08:46:49 -05:00
parent 6781a09940
commit f293b73d71
1 changed files with 4 additions and 0 deletions

View File

@ -75,6 +75,10 @@ IF(WIN32)
SET(_WIN32_WINNT ${WINVER}) SET(_WIN32_WINNT ${WINVER})
ENDIF(WIN32) 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(CheckCSourceCompiles)
INCLUDE(CheckCSourceRuns) INCLUDE(CheckCSourceRuns)