fi
dnl Check for headers
-AC_CHECK_HEADERS([endian.h sys/endian.h sys/shm.h])
+AC_CHECK_HEADERS([endian.h sys/endian.h sys/shm.h malloc.h])
dnl Check for resmgr support...
AC_MSG_CHECKING(for resmgr support)
#define bswap_16 bswap16
#define bswap_32 bswap32
#define bswap_64 bswap64
+#elif defined(__OpenBSD__)
+#include <sys/endian.h>
+#define bswap_16 swap16
+#define bswap_32 swap32
+#define bswap_64 swap64
#elif defined (__sun)
#include <sys/byteorder.h>
#define bswap_16 BSWAP_16
#include <endian.h>
#elif defined(HAVE_SYS_ENDIAN_H)
#include <sys/endian.h>
+#else
+#error Header defining endianness not defined
+#endif
#ifndef __BYTE_ORDER
#define __BYTE_ORDER BYTE_ORDER
#endif
#ifndef __BIG_ENDIAN
#define __BIG_ENDIAN BIG_ENDIAN
#endif
-#else
-#error Header defining endianness not defined
-#endif
#include <stdarg.h>
#include <poll.h>
#include <sys/types.h>
#define versionsort64 versionsort
#define alphasort64 alphasort
#define ino64_t ino_t
+#define fstat64 fstat
+#define stat64 stat
#endif
#define _snd_config_iterator list_head
#ifndef DOC_HIDDEN
#include <stdint.h>
-#ifdef __linux__
+#if defined(__linux__)
#include <linux/types.h>
#else
typedef uint8_t __u8;
typedef int32_t __s32;
typedef int64_t __s64;
+#if defined(__sun)
+#include <sys/byteorder.h>
+#define __cpu_to_le32 LE_32(x)
+#define __cpu_to_be32 BE_32(x)
+#define __cpu_to_le16 LE_16(x)
+#define __cpu_to_be16 BE_16(x)
+#else
#include <endian.h>
-#include <byteswap.h>
#if __BYTE_ORDER == __LITTLE_ENDIAN
#define __cpu_to_le32(x) (x)
#define __cpu_to_be32(x) bswap_32(x)
#define __cpu_to_le16(x) bswap_16(x)
#define __cpu_to_be16(x) (x)
#endif
+#endif
#define __le32_to_cpu __cpu_to_le32
#define __be32_to_cpu __cpu_to_be32
#define __le16_to_cpu __cpu_to_le16
#define __be16_to_cpu __cpu_to_be16
-
-#define __le64 __u64
-#define __le32 __u32
-#define __le16 __u16
-#define __le8 __u8
-#define __be64 __u64
-#define __be32 __u32
-#define __be16 __u16
-#define __be8 __u8
#endif
#ifndef __kernel_long_t
#ifndef __LINUX_UAPI_SND_ASOC_H
#define __LINUX_UAPI_SND_ASOC_H
+#if defined(__linux__)
#include <linux/types.h>
+#endif
/*
* Maximum number of channels topology kcontrol can represent.
static void snd_async_handler(int signo ATTRIBUTE_UNUSED, siginfo_t *siginfo, void *context ATTRIBUTE_UNUSED)
{
+#if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__OpenBSD__)
+ /* siginfo_t does not have si_fd */
+ struct list_head *i;
+ list_for_each(i, &snd_async_handlers) {
+ snd_async_handler_t *h = list_entry(i, snd_async_handler_t, glist);
+ if (h->callback)
+ h->callback(h);
+ }
+#else
int fd;
struct list_head *i;
//assert(siginfo->si_code == SI_SIGIO);
if (h->fd == fd && h->callback)
h->callback(h);
}
+#endif
}
/**
if (!S_ISDIR(st.st_mode))
return config_file_open(root, fn);
#ifndef DOC_HIDDEN
-#if defined(_GNU_SOURCE) && !defined(__NetBSD__) && !defined(__FreeBSD__) && !defined(__sun) && !defined(ANDROID)
+#if defined(_GNU_SOURCE) && !defined(__NetBSD__) && !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__sun) && !defined(ANDROID)
#define SORTFUNC versionsort64
#else
#define SORTFUNC alphasort64
#include <stdio.h>
#include <string.h>
+#if HAVE_MALLOC_H
#include <malloc.h>
+#endif
#include <stdarg.h>
#include <signal.h>
#include <ctype.h>
*
*/
+#if !defined(__OpenBSD__)
union semun {
int val; /* Value for SETVAL */
struct semid_ds *buf; /* Buffer for IPC_STAT, IPC_SET */
unsigned short *array; /* Array for GETALL, SETALL */
+#if defined(__linux__)
struct seminfo *__buf; /* Buffer for IPC_INFO (Linux specific) */
+#endif
};
+#endif
/*
* FIXME:
#include "config.h"
#include <stdio.h>
+#if HAVE_MALLOC_H
#include <malloc.h>
+#endif
#include <string.h>
#include <poll.h>
#include <sys/mman.h>
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#if HAVE_MALLOC_H
#include <malloc.h>
+#endif
#include "local.h"
#ifndef DOC_HIDDEN
#ifdef HAVE_SYS_SHM_H
#include <stdio.h>
+#include <stdlib.h>
+#if HAVE_MALLOC_H
#include <malloc.h>
+#endif
#include <string.h>
#include <errno.h>
#include <poll.h>
snprintf(filename, sizeof(filename), "%s/ucm2/conf.virt.d",
snd_config_topdir());
-#if defined(_GNU_SOURCE) && !defined(__NetBSD__) && !defined(__FreeBSD__) && !defined(__sun) && !defined(ANDROID)
+#if defined(_GNU_SOURCE) && !defined(__NetBSD__) && !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__sun) && !defined(ANDROID)
#define SORTFUNC versionsort64
#else
#define SORTFUNC alphasort64
#include <limits.h>
#include <dirent.h>
+#if defined(__NetBSD__) || defined(__OpenBSD__)
+#include <signal.h>
+extern char **environ;
+#endif
+
static pthread_mutex_t fork_lock = PTHREAD_MUTEX_INITIALIZER;
/*