From: Sergey Vlasov Date: Wed, 25 Apr 2001 16:15:40 +0000 (+0000) Subject: Fixed wint_t typedef detection (did not work with gcc-2.96) X-Git-Tag: local-account~7 X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=commitdiff_plain;h=02428cd04b921832f0293ea4d27563be3d69b1c0 Fixed wint_t typedef detection (did not work with gcc-2.96) --- diff --git a/ChangeLog.claws b/ChangeLog.claws index 92a66d561..ce7b60486 100644 --- a/ChangeLog.claws +++ b/ChangeLog.claws @@ -1,3 +1,9 @@ +2001-04-25 + + * ac/sv-check-type.m4: new autoconf macro. + * configure.in: fixed wint_t typedef detection (did not work + with gcc-2.96). + 2001-04-25 * acconfig.h: added USE_GTKGDK_XIM definition for autoheader. diff --git a/ac/sv-check-type.m4 b/ac/sv-check-type.m4 new file mode 100644 index 000000000..5caed61ac --- /dev/null +++ b/ac/sv-check-type.m4 @@ -0,0 +1,27 @@ +dnl sv_CHECK_TYPE(TYPE, DEFAULT [, INCLUDES]) +dnl +dnl Like AC_CHECK_TYPE, but in addition to `sys/types.h', `stdlib.h' and +dnl `stddef.h' checks files included by INCLUDES, which should be a +dnl series of #include statements. If TYPE is not defined, define it +dnl to DEFAULT. +dnl +AC_DEFUN(sv_CHECK_TYPE, +[AC_REQUIRE([AC_HEADER_STDC])dnl +AC_MSG_CHECKING(for $1) +AC_CACHE_VAL(sv_cv_type_$1, +[AC_TRY_COMPILE([ +#include +#if STDC_HEADERS +#include +#include +#endif +$3 +], [ +#undef $1 +int a = sizeof($1); +], sv_cv_type_$1=yes, sv_cv_type_$1=no)])dnl +AC_MSG_RESULT($sv_cv_type_$1) +if test $sv_cv_type_$1 = no; then + AC_DEFINE($1, $2) +fi +]) diff --git a/configure.in b/configure.in index d94615beb..7e81637b9 100644 --- a/configure.in +++ b/configure.in @@ -173,7 +173,8 @@ dnl Checks for header files. AC_HEADER_DIRENT AC_HEADER_STDC AC_HEADER_SYS_WAIT -AC_CHECK_HEADERS(fcntl.h sys/file.h unistd.h paths.h sys/param.h) +AC_CHECK_HEADERS(fcntl.h sys/file.h unistd.h paths.h sys/param.h \ + wchar.h wctype.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST @@ -181,11 +182,15 @@ AC_TYPE_OFF_T AC_TYPE_PID_T AC_TYPE_SIZE_T AC_STRUCT_TM -AC_CHECK_TYPE(wint_t, unsigned int) +sv_CHECK_TYPE(wint_t, unsigned int, +[ +#if (HAVE_WCHAR_H && HAVE_WCTYPE_H) +#include +#endif +]) dnl Checks for library functions. AC_FUNC_ALLOCA -AC_CHECK_HEADERS(wchar.h wctype.h) AC_CHECK_FUNCS(gethostname mkdir mktime socket strstr \ wcsstr wcswcs iswalnum iswspace towlower \ wcslen wcscpy wcsncpy \