瀏覽代碼

[miniaudio] Fixing miniaudio and Makefile for NetBSD (#4212)

* fixing miniaudio

* another fix for NetBSD

* adding wl-r. should not affect other bsd
pull/4243/head
NishiOwO 10 月之前
committed by GitHub
父節點
當前提交
fe9e371f27
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: B5690EEEBB952194
共有 2 個檔案被更改,包括 12 行新增2 行删除
  1. +2
    -2
      src/Makefile
  2. +10
    -0
      src/external/miniaudio.h

+ 2
- 2
src/Makefile 查看文件

@ -467,7 +467,7 @@ INCLUDE_PATHS = -I.
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW) ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW)
INCLUDE_PATHS += -Iexternal/glfw/include INCLUDE_PATHS += -Iexternal/glfw/include
ifeq ($(PLATFORM_OS),BSD) ifeq ($(PLATFORM_OS),BSD)
INCLUDE_PATHS += -I/usr/local/include
INCLUDE_PATHS += -I/usr/local/include -I/usr/pkg/include -I/usr/X11R7/include
endif endif
endif endif
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_SDL) ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_SDL)
@ -522,7 +522,7 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW)
LDFLAGS += -Wl,-soname,lib$(RAYLIB_LIB_NAME).so.$(RAYLIB_API_VERSION) LDFLAGS += -Wl,-soname,lib$(RAYLIB_LIB_NAME).so.$(RAYLIB_API_VERSION)
endif endif
ifeq ($(PLATFORM_OS),BSD) ifeq ($(PLATFORM_OS),BSD)
LDFLAGS += -Wl,-soname,lib$(RAYLIB_LIB_NAME).$(RAYLIB_API_VERSION).so -Lsrc -L/usr/local/lib
LDFLAGS += -Wl,-soname,lib$(RAYLIB_LIB_NAME).$(RAYLIB_API_VERSION).so -Lsrc -L/usr/local/lib -L/usr/pkg/lib -Wl,-R/usr/pkg/lib
endif endif
endif endif
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_SDL) ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_SDL)

+ 10
- 0
src/external/miniaudio.h 查看文件

@ -36078,9 +36078,15 @@ 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 (ioctl(fd, AUDIO_GETFORMAT, &fdInfo) < 0) {
return MA_ERROR;
}
#else
if (ioctl(fd, AUDIO_GETINFO, &fdInfo) < 0) { if (ioctl(fd, AUDIO_GETINFO, &fdInfo) < 0) {
return MA_ERROR; return MA_ERROR;
} }
#endif
if (deviceType == ma_device_type_playback) { if (deviceType == ma_device_type_playback) {
channels = fdInfo.play.channels; channels = fdInfo.play.channels;
@ -36358,7 +36364,11 @@ 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__
fdInfoResult = ioctl(fdctl, AUDIO_GETFORMAT, &fdInfo);
#else
fdInfoResult = ioctl(fdctl, AUDIO_GETINFO, &fdInfo); fdInfoResult = ioctl(fdctl, AUDIO_GETINFO, &fdInfo);
#endif
close(fdctl); close(fdctl);
} }
} }

Loading…
取消
儲存