From a7fc2822d450e57acca0656dc6a9fd4fbe13f4c1 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Wed, 24 May 2017 19:56:59 -0400 Subject: [PATCH] audio: rename bsd target to netbsd. Apparently this is no longer a generic BSD audio target, and hasn't been for years, so rename it for NetBSD. --- CMakeLists.txt | 8 ++-- configure | 18 ++----- configure.in | 4 +- include/SDL_config.h.cmake | 2 +- include/SDL_config.h.in | 2 +- src/audio/SDL_audio.c | 4 +- src/audio/SDL_audiodev.c | 2 +- src/audio/SDL_sysaudio.h | 2 +- .../SDL_netbsdaudio.c} | 48 +++++++++---------- .../SDL_netbsdaudio.h} | 0 10 files changed, 39 insertions(+), 51 deletions(-) rename src/audio/{bsd/SDL_bsdaudio.c => netbsd/SDL_netbsdaudio.c} (91%) rename src/audio/{bsd/SDL_bsdaudio.h => netbsd/SDL_netbsdaudio.h} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1d6886a436b9c..3471c45b65d3d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -855,10 +855,10 @@ elseif(UNIX AND NOT APPLE) file(GLOB SUN_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/sun/*.c) set(SOURCE_FILES ${SOURCE_FILES} ${SUN_AUDIO_SOURCES}) set(HAVE_SDL_AUDIO TRUE) - elseif(NETBSD OR OPENBSD) - set(SDL_AUDIO_DRIVER_BSD 1) - file(GLOB BSD_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/bsd/*.c) - set(SOURCE_FILES ${SOURCE_FILES} ${BSD_AUDIO_SOURCES}) + elseif(NETBSD) + set(SDL_AUDIO_DRIVER_NETBSD 1) + file(GLOB NETBSD_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/netbsd/*.c) + set(SOURCE_FILES ${SOURCE_FILES} ${NETBSD_AUDIO_SOURCES}) set(HAVE_SDL_AUDIO TRUE) elseif(AIX) set(SDL_AUDIO_DRIVER_PAUDIO 1) diff --git a/configure b/configure index 25420edbdb061..90ef087019448 100755 --- a/configure +++ b/configure @@ -745,7 +745,6 @@ infodir docdir oldincludedir includedir -runstatedir localstatedir sharedstatedir sysconfdir @@ -917,7 +916,6 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' -runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' @@ -1170,15 +1168,6 @@ do | -silent | --silent | --silen | --sile | --sil) silent=yes ;; - -runstatedir | --runstatedir | --runstatedi | --runstated \ - | --runstate | --runstat | --runsta | --runst | --runs \ - | --run | --ru | --r) - ac_prev=runstatedir ;; - -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ - | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ - | --run=* | --ru=* | --r=*) - runstatedir=$ac_optarg ;; - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1316,7 +1305,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir runstatedir + libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1469,7 +1458,6 @@ Fine tuning of the installation directories: --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -23318,9 +23306,9 @@ $as_echo "#define SDL_AUDIO_DRIVER_SUNAUDIO 1" >>confdefs.h ;; netbsd) # Don't use this on OpenBSD, it's busted. -$as_echo "#define SDL_AUDIO_DRIVER_BSD 1" >>confdefs.h +$as_echo "#define SDL_AUDIO_DRIVER_NETBSD 1" >>confdefs.h - SOURCES="$SOURCES $srcdir/src/audio/bsd/*.c" + SOURCES="$SOURCES $srcdir/src/audio/netbsd/*.c" have_audio=yes ;; aix) diff --git a/configure.in b/configure.in index 81ed3d7256ddd..c2d138a825f6f 100644 --- a/configure.in +++ b/configure.in @@ -3074,8 +3074,8 @@ case "$host" in have_audio=yes ;; netbsd) # Don't use this on OpenBSD, it's busted. - AC_DEFINE(SDL_AUDIO_DRIVER_BSD, 1, [ ]) - SOURCES="$SOURCES $srcdir/src/audio/bsd/*.c" + AC_DEFINE(SDL_AUDIO_DRIVER_NETBSD, 1, [ ]) + SOURCES="$SOURCES $srcdir/src/audio/netbsd/*.c" have_audio=yes ;; aix) diff --git a/include/SDL_config.h.cmake b/include/SDL_config.h.cmake index 7c82e528db7c2..85031204916ca 100644 --- a/include/SDL_config.h.cmake +++ b/include/SDL_config.h.cmake @@ -210,7 +210,7 @@ #cmakedefine SDL_AUDIO_DRIVER_PULSEAUDIO @SDL_AUDIO_DRIVER_PULSEAUDIO@ #cmakedefine SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC @SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC@ #cmakedefine SDL_AUDIO_DRIVER_HAIKU @SDL_AUDIO_DRIVER_HAIKU@ -#cmakedefine SDL_AUDIO_DRIVER_BSD @SDL_AUDIO_DRIVER_BSD@ +#cmakedefine SDL_AUDIO_DRIVER_NETBSD @SDL_AUDIO_DRIVER_NETBSD@ #cmakedefine SDL_AUDIO_DRIVER_COREAUDIO @SDL_AUDIO_DRIVER_COREAUDIO@ #cmakedefine SDL_AUDIO_DRIVER_DISK @SDL_AUDIO_DRIVER_DISK@ #cmakedefine SDL_AUDIO_DRIVER_DUMMY @SDL_AUDIO_DRIVER_DUMMY@ diff --git a/include/SDL_config.h.in b/include/SDL_config.h.in index 8fbde7d0bb920..b60f7e8ebd057 100644 --- a/include/SDL_config.h.in +++ b/include/SDL_config.h.in @@ -209,7 +209,7 @@ #undef SDL_AUDIO_DRIVER_PULSEAUDIO #undef SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC #undef SDL_AUDIO_DRIVER_HAIKU -#undef SDL_AUDIO_DRIVER_BSD +#undef SDL_AUDIO_DRIVER_NETBSD #undef SDL_AUDIO_DRIVER_COREAUDIO #undef SDL_AUDIO_DRIVER_DISK #undef SDL_AUDIO_DRIVER_DUMMY diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c index 95d1d9d7d8c70..a10eccd5e3450 100644 --- a/src/audio/SDL_audio.c +++ b/src/audio/SDL_audio.c @@ -44,8 +44,8 @@ static const AudioBootStrap *const bootstrap[] = { #if SDL_AUDIO_DRIVER_SNDIO &SNDIO_bootstrap, #endif -#if SDL_AUDIO_DRIVER_BSD - &BSD_AUDIO_bootstrap, +#if SDL_AUDIO_DRIVER_NETBSD + &NETBSDAUDIO_bootstrap, #endif #if SDL_AUDIO_DRIVER_OSS &DSP_bootstrap, diff --git a/src/audio/SDL_audiodev.c b/src/audio/SDL_audiodev.c index 89641c47367f3..d474a4d2ffbfd 100644 --- a/src/audio/SDL_audiodev.c +++ b/src/audio/SDL_audiodev.c @@ -22,7 +22,7 @@ /* Get the name of the audio device we use for output */ -#if SDL_AUDIO_DRIVER_BSD || SDL_AUDIO_DRIVER_OSS || SDL_AUDIO_DRIVER_SUNAUDIO +#if SDL_AUDIO_DRIVER_NETBSD || SDL_AUDIO_DRIVER_OSS || SDL_AUDIO_DRIVER_SUNAUDIO #include #include diff --git a/src/audio/SDL_sysaudio.h b/src/audio/SDL_sysaudio.h index b66fd89abb6e5..bda9d829fc610 100644 --- a/src/audio/SDL_sysaudio.h +++ b/src/audio/SDL_sysaudio.h @@ -183,7 +183,7 @@ typedef struct AudioBootStrap extern AudioBootStrap PULSEAUDIO_bootstrap; extern AudioBootStrap ALSA_bootstrap; extern AudioBootStrap SNDIO_bootstrap; -extern AudioBootStrap BSD_AUDIO_bootstrap; +extern AudioBootStrap NETBSDAUDIO_bootstrap; extern AudioBootStrap DSP_bootstrap; extern AudioBootStrap QSAAUDIO_bootstrap; extern AudioBootStrap SUNAUDIO_bootstrap; diff --git a/src/audio/bsd/SDL_bsdaudio.c b/src/audio/netbsd/SDL_netbsdaudio.c similarity index 91% rename from src/audio/bsd/SDL_bsdaudio.c rename to src/audio/netbsd/SDL_netbsdaudio.c index b68ca2185e56b..8a3d6d7a870cc 100644 --- a/src/audio/bsd/SDL_bsdaudio.c +++ b/src/audio/netbsd/SDL_netbsdaudio.c @@ -20,10 +20,10 @@ */ #include "../../SDL_internal.h" -#if SDL_AUDIO_DRIVER_BSD +#if SDL_AUDIO_DRIVER_NETBSD /* - * Driver for native OpenBSD/NetBSD audio(4). + * Driver for native NetBSD audio(4). * vedge@vedge.com.ar. */ @@ -50,14 +50,14 @@ static void -BSDAUDIO_DetectDevices(void) +NETBSDAUDIO_DetectDevices(void) { SDL_EnumUnixAudioDevices(0, NULL); } static void -BSDAUDIO_Status(_THIS) +NETBSDAUDIO_Status(_THIS) { #ifdef DEBUG_AUDIO /* *INDENT-OFF* */ @@ -121,7 +121,7 @@ BSDAUDIO_Status(_THIS) /* This function waits until it is possible to write a full sound buffer */ static void -BSDAUDIO_WaitDevice(_THIS) +NETBSDAUDIO_WaitDevice(_THIS) { #ifndef USE_BLOCKING_WRITES /* Not necessary when using blocking writes */ /* See if we need to use timed audio synchronization */ @@ -169,7 +169,7 @@ BSDAUDIO_WaitDevice(_THIS) } static void -BSDAUDIO_PlayDevice(_THIS) +NETBSDAUDIO_PlayDevice(_THIS) { int written, p = 0; @@ -208,14 +208,14 @@ BSDAUDIO_PlayDevice(_THIS) } static Uint8 * -BSDAUDIO_GetDeviceBuf(_THIS) +NETBSDAUDIO_GetDeviceBuf(_THIS) { return (this->hidden->mixbuf); } static int -BSDAUDIO_CaptureFromDevice(_THIS, void *_buffer, int buflen) +NETBSDAUDIO_CaptureFromDevice(_THIS, void *_buffer, int buflen) { Uint8 *buffer = (Uint8 *) _buffer; int br, p = 0; @@ -243,7 +243,7 @@ BSDAUDIO_CaptureFromDevice(_THIS, void *_buffer, int buflen) } static void -BSDAUDIO_FlushCapture(_THIS) +NETBSDAUDIO_FlushCapture(_THIS) { audio_info_t info; size_t remain; @@ -265,7 +265,7 @@ BSDAUDIO_FlushCapture(_THIS) } static void -BSDAUDIO_CloseDevice(_THIS) +NETBSDAUDIO_CloseDevice(_THIS) { if (this->hidden->audio_fd >= 0) { close(this->hidden->audio_fd); @@ -275,7 +275,7 @@ BSDAUDIO_CloseDevice(_THIS) } static int -BSDAUDIO_OpenDevice(_THIS, void *handle, const char *devname, int iscapture) +NETBSDAUDIO_OpenDevice(_THIS, void *handle, const char *devname, int iscapture) { const int flags = iscapture ? OPEN_FLAGS_INPUT : OPEN_FLAGS_OUTPUT; SDL_AudioFormat format = 0; @@ -383,24 +383,24 @@ BSDAUDIO_OpenDevice(_THIS, void *handle, const char *devname, int iscapture) SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size); } - BSDAUDIO_Status(this); + NETBSDAUDIO_Status(this); /* We're ready to rock and roll. :-) */ return 0; } static int -BSDAUDIO_Init(SDL_AudioDriverImpl * impl) +NETBSDAUDIO_Init(SDL_AudioDriverImpl * impl) { /* Set the function pointers */ - impl->DetectDevices = BSDAUDIO_DetectDevices; - impl->OpenDevice = BSDAUDIO_OpenDevice; - impl->PlayDevice = BSDAUDIO_PlayDevice; - impl->WaitDevice = BSDAUDIO_WaitDevice; - impl->GetDeviceBuf = BSDAUDIO_GetDeviceBuf; - impl->CloseDevice = BSDAUDIO_CloseDevice; - impl->CaptureFromDevice = BSDAUDIO_CaptureFromDevice; - impl->FlushCapture = BSDAUDIO_FlushCapture; + impl->DetectDevices = NETBSDAUDIO_DetectDevices; + impl->OpenDevice = NETBSDAUDIO_OpenDevice; + impl->PlayDevice = NETBSDAUDIO_PlayDevice; + impl->WaitDevice = NETBSDAUDIO_WaitDevice; + impl->GetDeviceBuf = NETBSDAUDIO_GetDeviceBuf; + impl->CloseDevice = NETBSDAUDIO_CloseDevice; + impl->CaptureFromDevice = NETBSDAUDIO_CaptureFromDevice; + impl->FlushCapture = NETBSDAUDIO_FlushCapture; impl->HasCaptureSupport = SDL_TRUE; impl->AllowsArbitraryDeviceNames = 1; @@ -409,10 +409,10 @@ BSDAUDIO_Init(SDL_AudioDriverImpl * impl) } -AudioBootStrap BSD_AUDIO_bootstrap = { - "bsd", "BSD audio", BSDAUDIO_Init, 0 +AudioBootStrap NETBSDAUDIO_bootstrap = { + "netbsd", "NetBSD audio", NETBSDAUDIO_Init, 0 }; -#endif /* SDL_AUDIO_DRIVER_BSD */ +#endif /* SDL_AUDIO_DRIVER_NETBSD */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/bsd/SDL_bsdaudio.h b/src/audio/netbsd/SDL_netbsdaudio.h similarity index 100% rename from src/audio/bsd/SDL_bsdaudio.h rename to src/audio/netbsd/SDL_netbsdaudio.h