mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-22 00:06:59 +02:00
check __NetBSD_Version__
This commit is contained in:
+6
-2
@@ -36049,6 +36049,10 @@ audio(4) Backend
|
|||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <sys/audioio.h>
|
#include <sys/audioio.h>
|
||||||
|
|
||||||
|
#ifdef __NetBSD__
|
||||||
|
#include <sys/param.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(__OpenBSD__)
|
#if defined(__OpenBSD__)
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#if defined(OpenBSD) && OpenBSD >= 201709
|
#if defined(OpenBSD) && OpenBSD >= 201709
|
||||||
@@ -36268,7 +36272,7 @@ static ma_result ma_context_get_device_info_from_fd__audio4(ma_context* pContext
|
|||||||
ma_uint32 channels;
|
ma_uint32 channels;
|
||||||
ma_uint32 sampleRate;
|
ma_uint32 sampleRate;
|
||||||
|
|
||||||
#ifdef __NetBSD__
|
#if defined(__NetBSD__) && (__NetBSD_Version__ > 900000000)
|
||||||
if (ioctl(fd, AUDIO_GETFORMAT, &fdInfo) < 0) {
|
if (ioctl(fd, AUDIO_GETFORMAT, &fdInfo) < 0) {
|
||||||
return MA_ERROR;
|
return MA_ERROR;
|
||||||
}
|
}
|
||||||
@@ -36554,7 +36558,7 @@ static ma_result ma_device_init_fd__audio4(ma_device* pDevice, const ma_device_c
|
|||||||
/* We're using a default device. Get the info from the /dev/audioctl file instead of /dev/audio. */
|
/* We're using a default device. Get the info from the /dev/audioctl file instead of /dev/audio. */
|
||||||
int fdctl = open(pDefaultDeviceCtlNames[iDefaultDevice], fdFlags, 0);
|
int fdctl = open(pDefaultDeviceCtlNames[iDefaultDevice], fdFlags, 0);
|
||||||
if (fdctl != -1) {
|
if (fdctl != -1) {
|
||||||
#ifdef __NetBSD__
|
#if defined(__NetBSD__) && (__NetBSD_Version__ > 900000000)
|
||||||
fdInfoResult = ioctl(fdctl, AUDIO_GETFORMAT, &fdInfo);
|
fdInfoResult = ioctl(fdctl, AUDIO_GETFORMAT, &fdInfo);
|
||||||
#else
|
#else
|
||||||
fdInfoResult = ioctl(fdctl, AUDIO_GETINFO, &fdInfo);
|
fdInfoResult = ioctl(fdctl, AUDIO_GETINFO, &fdInfo);
|
||||||
|
|||||||
Reference in New Issue
Block a user