|
105 | 105 |
|
106 | 106 | # PGAC_FUNC_STRERROR_R_INT
|
107 | 107 | # ---------------------------
|
108 |
| -# Check if strerror_r() returns an int (SUSv3) rather than a char * (GNU libc) |
109 |
| -# If so, define STRERROR_R_INT |
| 108 | +# Check if strerror_r() returns int (POSIX) rather than char * (GNU libc). |
| 109 | +# If so, define STRERROR_R_INT. |
| 110 | +# The result is uncertain if strerror_r() isn't provided, |
| 111 | +# but we don't much care. |
110 | 112 | AC_DEFUN([PGAC_FUNC_STRERROR_R_INT],
|
111 | 113 | [AC_CACHE_CHECK(whether strerror_r returns int,
|
112 | 114 | pgac_cv_func_strerror_r_int,
|
113 | 115 | [AC_TRY_COMPILE([#include <string.h>],
|
114 |
| -[#ifndef _AIX |
115 |
| -int strerror_r(int, char *, size_t); |
116 |
| -#else |
117 |
| -/* Older AIX has 'int' for the third argument so we don't test the args. */ |
118 |
| -int strerror_r(); |
119 |
| -#endif], |
| 116 | +[char buf[100]; |
| 117 | + switch (strerror_r(1, buf, sizeof(buf))) |
| 118 | + { case 0: break; default: break; } |
| 119 | +], |
120 | 120 | [pgac_cv_func_strerror_r_int=yes],
|
121 | 121 | [pgac_cv_func_strerror_r_int=no])])
|
122 | 122 | if test x"$pgac_cv_func_strerror_r_int" = xyes ; then
|
123 | 123 | AC_DEFINE(STRERROR_R_INT, 1,
|
124 |
| - [Define to 1 if strerror_r() returns a int.]) |
| 124 | + [Define to 1 if strerror_r() returns int.]) |
125 | 125 | fi
|
126 | 126 | ])# PGAC_FUNC_STRERROR_R_INT
|
127 | 127 |
|
|
366 | 366 | if test "$pgac_cv_type_locale_t" = 'yes (in xlocale.h)'; then
|
367 | 367 | AC_DEFINE(LOCALE_T_IN_XLOCALE, 1,
|
368 | 368 | [Define to 1 if `locale_t' requires <xlocale.h>.])
|
369 |
| -fi])])# PGAC_HEADER_XLOCALE |
| 369 | +fi])# PGAC_TYPE_LOCALE_T |
| 370 | + |
| 371 | + |
| 372 | +# PGAC_FUNC_WCSTOMBS_L |
| 373 | +# -------------------- |
| 374 | +# Try to find a declaration for wcstombs_l(). It might be in stdlib.h |
| 375 | +# (following the POSIX requirement for wcstombs()), or in locale.h, or in |
| 376 | +# xlocale.h. If it's in the latter, define WCSTOMBS_L_IN_XLOCALE. |
| 377 | +# |
| 378 | +AC_DEFUN([PGAC_FUNC_WCSTOMBS_L], |
| 379 | +[AC_CACHE_CHECK([for wcstombs_l declaration], pgac_cv_func_wcstombs_l, |
| 380 | +[AC_COMPILE_IFELSE([AC_LANG_PROGRAM( |
| 381 | +[#include <stdlib.h> |
| 382 | +#include <locale.h>], |
| 383 | +[#ifndef wcstombs_l |
| 384 | +(void) wcstombs_l; |
| 385 | +#endif])], |
| 386 | +[pgac_cv_func_wcstombs_l='yes'], |
| 387 | +[AC_COMPILE_IFELSE([AC_LANG_PROGRAM( |
| 388 | +[#include <stdlib.h> |
| 389 | +#include <locale.h> |
| 390 | +#include <xlocale.h>], |
| 391 | +[#ifndef wcstombs_l |
| 392 | +(void) wcstombs_l; |
| 393 | +#endif])], |
| 394 | +[pgac_cv_func_wcstombs_l='yes (in xlocale.h)'], |
| 395 | +[pgac_cv_func_wcstombs_l='no'])])]) |
| 396 | +if test "$pgac_cv_func_wcstombs_l" = 'yes (in xlocale.h)'; then |
| 397 | + AC_DEFINE(WCSTOMBS_L_IN_XLOCALE, 1, |
| 398 | + [Define to 1 if `wcstombs_l' requires <xlocale.h>.]) |
| 399 | +fi])# PGAC_FUNC_WCSTOMBS_L |
0 commit comments