Check the size in configure.ac/CMakeLists.txt,
and react as needed in libarchive/archive_string.c.
SVN-Revision: 819
ENDIF(MSVC)
ENDIF(NOT HAVE_UINTMAX_T)
#
+CHECK_TYPE_SIZE(wchar_t SIZEOF_WCHAR_T)
+#
# Check if _FILE_OFFSET_BITS macro needed for large files
#
CHECK_FILE_OFFSET_BITS()
[AC_DEFINE(HAVE_EILSEQ, 1, [A possible errno value for invalid file format errors])],
[],
[#include <errno.h>])
+AC_CHECK_TYPE([wchar_t],
+ [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_[]wchar_t), 1, [Define to 1 if the system has the type `wchar_t'.])dnl
+ AC_CHECK_SIZEOF([wchar_t])],
+ [])
+
AC_HEADER_TIME
# Checks for library functions.
p[1] = 0x80 | (wc & 0x3f);
return (2);
}
+#if SIZEOF_WCHAR_T > 2
if (wc <= 0xffff) {
p[0] = 0xe0 | ((wc >> 12) & 0x0f);
p[1] = 0x80 | ((wc >> 6) & 0x3f);
* can actually fail.
*/
return (-1);
+#else
+ /* is this the right thing to do when wchar_t is
+ * limited to 16 bits?
+ */
+ p[0] = 0xe0 | ((wc >> 12) & 0x0f);
+ p[1] = 0x80 | ((wc >> 6) & 0x3f);
+ p[2] = 0x80 | (wc & 0x3f);
+ return (3);
+#endif
}
static int