summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOBATA Akio <obache@wizdas.com>2024-06-20 17:40:24 +0900
committerOBATA Akio <obache@wizdas.com>2024-06-20 17:57:41 +0900
commit0c717ee493b802d94756b6c5f538cd686943b941 (patch)
tree73490261af3438731cc90841795943b8d2bc2ed1
parent6a380400d09ee49eb0f5d142a6e1e816ed2615a2 (diff)
downloadarts-0c717ee493b802d94756b6c5f538cd686943b941.tar.gz
arts-0c717ee493b802d94756b6c5f538cd686943b941.zip
fix to use AudioIOSun on Solaris and NetBSD
`USE_SOLARIS` is not defined (related to TDE/tde#74). On NetBSD, native audio system audioio(4) i.e. sunaudio is preferred. Signed-off-by: OBATA Akio <obache@wizdas.com>
-rw-r--r--flow/audioiosun.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/flow/audioiosun.cpp b/flow/audioiosun.cpp
index ed5722c..16dee36 100644
--- a/flow/audioiosun.cpp
+++ b/flow/audioiosun.cpp
@@ -45,9 +45,9 @@
#endif
/*
- * Only compile this AudioIO class if we're on Solaris
+ * Only compile this AudioIO class if we're on Solaris or NetBSD
*/
-#ifdef USE_SOLARIS
+#if defined(__sun) || defined(__NetBSD__)
#include <sys/types.h>
#include <sys/ioctl.h>
@@ -55,8 +55,10 @@
#include <sys/stat.h>
#include <sys/audioio.h>
+#ifdef __sun
#include <stropts.h>
#include <sys/conf.h>
+#endif
#include <assert.h>
#include <errno.h>
@@ -73,6 +75,10 @@
#include "iomanager.h"
#include "dispatcher.h"
+#ifdef __NetBSD__
+typedef u_int uint_t;
+#endif
+
// This looks like the maximum buffer size according to the sys/audio*.h
// files on Solaris7
#define SUN_MAX_BUFFER_SIZE (65536)
@@ -439,4 +445,4 @@ int AudioIOSun::write(void *buffer, int size)
return size;
}
-#endif /* USE_SOLARIS */
+#endif /* defined(__sun) || defined(__NetBSD__) */