diff options
Diffstat (limited to 'm4/ssize_t.m4')
-rw-r--r-- | m4/ssize_t.m4 | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/m4/ssize_t.m4 b/m4/ssize_t.m4 new file mode 100644 index 0000000..3c75038 --- /dev/null +++ b/m4/ssize_t.m4 @@ -0,0 +1,20 @@ +# serial 1 + +dnl From Bruno Haible. +dnl Test whether ssize_t is defined. +dnl Prerequisite: AC_CHECK_HEADERS(unistd.h) + +AC_DEFUN([gt_TYPE_SSIZE_T], +[ + AC_CACHE_CHECK([for ssize_t], gt_cv_ssize_t, + [AC_TRY_COMPILE([ +#include <sys/types.h> +#if HAVE_UNISTD_H +#include <unistd.h> +#endif], [int x = sizeof (ssize_t *) + sizeof (ssize_t);], + gt_cv_ssize_t=yes, gt_cv_ssize_t=no)]) + if test $gt_cv_ssize_t = no; then + AC_DEFINE(ssize_t, int, + [Define as a signed type of the same size as size_t.]) + fi +]) |