Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -492,10 +492,13 @@ [AC_DEFINE(OF_HAVE_MAX_ALIGN_T, 1, [Whether we have max_align_t])]) AC_CHECK_HEADER(stdnoreturn.h, [AC_DEFINE(OF_HAVE_STDNORETURN_H, 1, [Whether we have stdnoreturn.h])]) +AC_CHECK_TYPE(wchar_t) +AC_CHECK_HEADER(wchar.h) + AC_CHECK_SIZEOF(float) AC_CHECK_SIZEOF(double) AS_IF([test x"$ac_cv_sizeof_float" != x"4" -o x"$ac_cv_sizeof_double" != x"8"], [AC_MSG_ERROR( [Floating point implementation does not conform to IEEE 754!])]) Index: src/of_asprintf.m ================================================================== --- src/of_asprintf.m +++ src/of_asprintf.m @@ -19,11 +19,14 @@ #include #include #include #include #include -#include + +#ifdef HAVE_WCHAR_H +# include +#endif #ifdef HAVE_ASPRINTF_L # include #endif #ifdef HAVE_XLOCALE_H @@ -579,18 +582,20 @@ case LENGTH_MODIFIER_NONE: tmpLen = asprintf(&tmp, ctx->subformat, va_arg(ctx->arguments, int)); break; case LENGTH_MODIFIER_L: -#if WINT_MAX >= INT_MAX +#ifdef HAVE_WCHAR_H +# if WINT_MAX >= INT_MAX tmpLen = asprintf(&tmp, ctx->subformat, va_arg(ctx->arguments, wint_t)); -#else +# else tmpLen = asprintf(&tmp, ctx->subformat, va_arg(ctx->arguments, int)); -#endif +# endif break; +#endif default: return false; } break; @@ -598,14 +603,16 @@ switch (ctx->lengthModifier) { case LENGTH_MODIFIER_NONE: tmpLen = asprintf(&tmp, ctx->subformat, va_arg(ctx->arguments, const char*)); break; +#ifdef HAVE_WCHAR_T case LENGTH_MODIFIER_L: tmpLen = asprintf(&tmp, ctx->subformat, va_arg(ctx->arguments, const wchar_t*)); break; +#endif default: return false; } break;