summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAhmad Fatoum <[email protected]>2018-02-11 11:59:36 +0100
committerAhmad Fatoum <[email protected]>2018-02-11 12:20:17 +0100
commit09b022305f3fd365d5d0424ff51982bcca5a572f (patch)
tree86685023ed019493b31e8a3745e51806c8285c1e
parentd90a33b850d825c3047fd570478fc8a66f22414f (diff)
downloadraylib-09b022305f3fd365d5d0424ff51982bcca5a572f.tar.gz
raylib-09b022305f3fd365d5d0424ff51982bcca5a572f.zip
mini_al: Support {Net,Open}BSD OSS
Fixes this build failure: http://www.cpantesters.org/cpan/report/a069fade-0e1f-11e8-a1cf-bb670eaac09d
-rw-r--r--src/external/mini_al.h6
-rw-r--r--utils.cmake6
2 files changed, 10 insertions, 2 deletions
diff --git a/src/external/mini_al.h b/src/external/mini_al.h
index 35846385..c9ab40fa 100644
--- a/src/external/mini_al.h
+++ b/src/external/mini_al.h
@@ -59,7 +59,7 @@
//
// Building (BSD)
// --------------
-// The BSD build uses OSS and should Just Work without any linking nor include path configuration.
+// BSD build uses OSS. Requires linking to -lossaudio on {Open,Net}BSD, but not FreeBSD.
//
// Building (Emscripten)
// ---------------------
@@ -6712,6 +6712,10 @@ static mal_result mal_device__main_loop__alsa(mal_device* pDevice)
#include <fcntl.h>
#include <sys/soundcard.h>
+#ifndef SNDCTL_DSP_HALT
+#define SNDCTL_DSP_HALT SNDCTL_DSP_RESET
+#endif
+
int mal_open_temp_device__oss()
{
// The OSS sample code uses "/dev/mixer" as the device for getting system properties so I'm going to do the same.
diff --git a/utils.cmake b/utils.cmake
index 68fd1f76..dd4160d3 100644
--- a/utils.cmake
+++ b/utils.cmake
@@ -32,7 +32,11 @@ else()
find_library(XCURSOR_LIBRARY Xcursor)
include_directories(${OPENGL_INCLUDE_DIR})
- set(LIBS_PRIVATE m ${pthread} ${OPENGL_LIBRARIES} ${X11_LIBRARIES} ${XRANDR_LIBRARY} ${XINERAMA_LIBRARY} ${XI_LIBRARY} ${XXF86VM_LIBRARY} ${XCURSOR_LIBRARY})
+ if ("${CMAKE_SYSTEM_NAME}" MATCHES "(Net|Open)BSD")
+ find_library(OSS_LIBRARY ossaudio)
+ endif()
+
+ set(LIBS_PRIVATE m ${pthread} ${OPENGL_LIBRARIES} ${X11_LIBRARIES} ${XRANDR_LIBRARY} ${XINERAMA_LIBRARY} ${XI_LIBRARY} ${XXF86VM_LIBRARY} ${XCURSOR_LIBRARY} ${OSS_LIBRARY})
endif()
endif()