@@ -65,7 +65,7 @@ AC_HEADER_TIME
dnl Checks for library functions.
AC_PROG_GCC_TRADITIONAL
-AC_CHECK_FUNCS([uselocale])
+AC_CHECK_FUNCS([uselocale versionsort])
SAVE_LIBRARY_VERSION
AC_SUBST(LIBTOOL_VERSION_INFO)
@@ -311,7 +311,7 @@ fi
AC_SUBST(ALSA_DEPLIBS)
dnl Check for headers
-AC_CHECK_HEADERS([wordexp.h endian.h sys/endian.h])
+AC_CHECK_HEADERS([wordexp.h endian.h sys/endian.h linux/types.h linux/ioctl.h])
dnl Check for resmgr support...
AC_MSG_CHECKING(for resmgr support)
@@ -23,6 +23,9 @@ struct list_head {
#define LIST_HEAD_INIT(name) { &(name), &(name) }
+#ifdef LIST_HEAD
+#undef LIST_HEAD
+#endif
#define LIST_HEAD(name) \
struct list_head name = LIST_HEAD_INIT(name)
@@ -50,8 +50,18 @@
#include <sys/poll.h>
#include <sys/types.h>
#include <errno.h>
+#ifndef ESTRPIPE
+#define ESTRPIPE EPIPE
+#endif
+#ifndef EBADFD
+#define EBADFD EBADF
+#endif
+#if HAVE_LINUX_TYPES_H
#include <linux/types.h>
+#endif
+#if HAVE_LINUX_IOCTL_H
#include <linux/ioctl.h>
+#endif
#ifdef SUPPORT_RESMGR
#include <resmgr.h>
@@ -23,7 +23,19 @@
#ifndef _UAPI__SOUND_ASOUND_H
#define _UAPI__SOUND_ASOUND_H
-#include <linux/types.h>
+#include <sys/ioctl.h>
+#include <sys/types.h>
+#include <stdint.h>
+#ifdef __CHECKER__
+#define __bitwise__ __attribute__((bitwise))
+#else
+#define __bitwise__
+#endif
+#ifdef __CHECK_ENDIAN__
+#define __bitwise __bitwise__
+#else
+#define __bitwise
+#endif
/*
@@ -348,7 +360,7 @@ struct snd_interval {
#define SNDRV_MASK_MAX 256
struct snd_mask {
- __u32 bits[(SNDRV_MASK_MAX+31)/32];
+ uint32_t bits[(SNDRV_MASK_MAX+31)/32];
};
struct snd_pcm_hw_params {
@@ -391,7 +403,7 @@ struct snd_pcm_sw_params {
struct snd_pcm_channel_info {
unsigned int channel;
- __kernel_off_t offset; /* mmap offset */
+ off_t offset; /* mmap offset */
unsigned int first; /* offset to first sample in bits */
unsigned int step; /* samples distance in bits */
};
@@ -407,7 +419,7 @@ struct snd_pcm_status {
snd_pcm_uframes_t avail_max; /* max frames available on hw since last status */
snd_pcm_uframes_t overrange; /* count of ADC (capture) overrange detections from last status */
snd_pcm_state_t suspended_state; /* suspended stream state */
- __u32 reserved_alignment; /* must be filled with zero */
+ uint32_t reserved_alignment; /* must be filled with zero */
struct timespec audio_tstamp; /* from sample counter or wall clock */
unsigned char reserved[56-sizeof(struct timespec)]; /* must be filled with zero */
};
@@ -838,7 +850,7 @@ struct snd_ctl_elem_info {
snd_ctl_elem_type_t type; /* R: value type - SNDRV_CTL_ELEM_TYPE_* */
unsigned int access; /* R: value access (bitmask) - SNDRV_CTL_ELEM_ACCESS_* */
unsigned int count; /* count of values */
- __kernel_pid_t owner; /* owner's PID of this control */
+ pid_t owner; /* owner's PID of this control */
union {
struct {
long min; /* R: minimum value */
@@ -854,7 +866,7 @@ struct snd_ctl_elem_info {
unsigned int items; /* R: number of items */
unsigned int item; /* W: item number */
char name[64]; /* R: value name */
- __u64 names_ptr; /* W: names list (ELEM_ADD only) */
+ uint64_t names_ptr; /* W: names list (ELEM_ADD only) */
unsigned int names_length;
} enumerated;
unsigned char reserved[128];
@@ -3517,7 +3517,7 @@ int snd_config_hook_load(snd_config_t *root, snd_config_t *config, snd_config_t
int n;
#ifndef DOC_HIDDEN
-#ifdef _GNU_SOURCE
+#if defined(HAVE_VERSIONSORT) && defined(_GNU_SOURCE)
#define SORTFUNC versionsort
#else
#define SORTFUNC alphasort