|
Packit |
eed494 |
dnl xiph_types.m4
|
|
Packit |
eed494 |
dnl macros for type checks not covered by autoconf
|
|
Packit |
eed494 |
|
|
Packit |
eed494 |
dnl XIPH_C99_INTTYPES
|
|
Packit |
eed494 |
dnl Brendan Cully
|
|
Packit |
eed494 |
dnl
|
|
Packit |
eed494 |
# XIPH_C99_INTTYPES
|
|
Packit |
eed494 |
# Check for C99 integer type definitions, or define if missing
|
|
Packit |
eed494 |
AC_DEFUN([XIPH_C99_INTTYPES],
|
|
Packit |
eed494 |
[dnl
|
|
Packit |
eed494 |
AC_CHECK_HEADERS([inttypes.h])
|
|
Packit |
eed494 |
AC_CHECK_TYPE([uint32_t],
|
|
Packit |
eed494 |
[AC_DEFINE(HAVE_C99_INTTYPES, 1, [Define if you have the C99 integer types])],
|
|
Packit |
eed494 |
[AC_CHECK_SIZEOF(short)
|
|
Packit |
eed494 |
AC_CHECK_SIZEOF(int)
|
|
Packit |
eed494 |
AC_CHECK_SIZEOF(long)
|
|
Packit |
eed494 |
AC_CHECK_SIZEOF(long long)])
|
|
Packit |
eed494 |
AH_VERBATIM([X_HAVE_C99_INTTYPES],
|
|
Packit |
eed494 |
[#ifndef HAVE_C99_INTTYPES
|
|
Packit |
eed494 |
# if SIZEOF_SHORT == 4
|
|
Packit |
eed494 |
typedef unsigned short uint32_t;
|
|
Packit |
eed494 |
# elif SIZEOF_INT == 4
|
|
Packit |
eed494 |
typedef unsigned int uint32_t;
|
|
Packit |
eed494 |
# elif SIZEOF_LONG == 4
|
|
Packit |
eed494 |
typedef unsigned long uint32_t;
|
|
Packit |
eed494 |
# endif
|
|
Packit |
eed494 |
# if SIZEOF_INT == 8
|
|
Packit |
eed494 |
typedef unsigned int uint64_t;
|
|
Packit |
eed494 |
# elif SIZEOF_LONG == 8
|
|
Packit |
eed494 |
typedef unsigned long uint64_t;
|
|
Packit |
eed494 |
# elif SIZEOF_LONG_LONG == 8
|
|
Packit |
eed494 |
typedef unsigned long long uint64_t;
|
|
Packit |
eed494 |
# endif
|
|
Packit |
eed494 |
#endif
|
|
Packit |
eed494 |
])
|
|
Packit |
eed494 |
])
|
|
Packit |
eed494 |
|
|
Packit |
eed494 |
dnl XIPH_TYPE_SOCKLEN_T
|
|
Packit |
eed494 |
dnl Brendan Cully
|
|
Packit |
eed494 |
dnl
|
|
Packit |
eed494 |
# XIPH_TYPE_SOCKLEN_T
|
|
Packit |
eed494 |
# Check for socklen_t, or define as int if missing
|
|
Packit |
eed494 |
AC_DEFUN([XIPH_TYPE_SOCKLEN_T],
|
|
Packit |
eed494 |
[dnl
|
|
Packit |
eed494 |
AC_CHECK_HEADERS([sys/socket.h])
|
|
Packit |
eed494 |
AC_CHECK_TYPES([socklen_t],,,
|
|
Packit |
eed494 |
[#if HAVE_SYS_TYPES_H
|
|
Packit |
eed494 |
# include <sys/types.h>
|
|
Packit |
eed494 |
#endif
|
|
Packit |
eed494 |
#if HAVE_SYS_SOCKET_H
|
|
Packit |
eed494 |
# include <sys/socket.h>
|
|
Packit |
eed494 |
#endif
|
|
Packit |
eed494 |
])
|
|
Packit |
eed494 |
AH_VERBATIM([X_HAVE_SOCKLEN_T],
|
|
Packit |
eed494 |
[#ifndef HAVE_SOCKLEN_T
|
|
Packit |
eed494 |
typedef int socklen_t;
|
|
Packit |
eed494 |
#endif
|
|
Packit |
eed494 |
])
|
|
Packit |
eed494 |
])
|