diff --git a/.azure/Dockerfile.azure-alpine b/.azure/Dockerfile.azure-alpine index bbdbb9036..02ccd39b1 100644 --- a/.azure/Dockerfile.azure-alpine +++ b/.azure/Dockerfile.azure-alpine @@ -6,7 +6,10 @@ RUN apk add --no-cache --virtual .pipeline-deps readline linux-pam \ && apk add \ cmake make \ glib-dev \ + dbus-dev \ ladspa-dev \ + libsndfile-dev \ + sdl2-dev \ nodejs-current \ gcc g++ \ pkgconf \ diff --git a/.azure/azure-pipelines-alpine.yml b/.azure/azure-pipelines-alpine.yml index 2b530c6c4..d7eaa1a82 100644 --- a/.azure/azure-pipelines-alpine.yml +++ b/.azure/azure-pipelines-alpine.yml @@ -75,7 +75,7 @@ stages: gentoo-flags: CFLAGS: '-pipe -frecord-gcc-switches -fno-diagnostics-color -fmessage-length=0 -D_POSIX_C_SOURCE=199506L' CXXFLAGS: '-pipe -frecord-gcc-switches -fno-diagnostics-color -fmessage-length=0' - CMFLAGS: '-Denable-profiling=yes -Denable-pulseaudio=no -Denable-pipewire=no -Denable-readline=yes -Denable-systemd=no -Denable-threads=no -Denable-trap-on-fpe=yes -Denable-ubsan=OFF' + CMFLAGS: '-Denable-profiling=yes -Denable-readline=yes -Denable-systemd=no -Denable-threads=no -Denable-trap-on-fpe=yes -Denable-ubsan=OFF' strncasecmp-flags: CFLAGS: '-D_POSIX_C_SOURCE=199506L -DNCURSES_WIDECHAR' CMFLAGS: '-Denable-floats=1 -Denable-benchmark=1' diff --git a/CMakeLists.txt b/CMakeLists.txt index 3b12afab8..dfa365d04 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -159,6 +159,7 @@ include ( CheckIncludeFile ) include ( CheckSymbolExists ) include ( CheckTypeSize ) check_include_file ( string.h HAVE_STRING_H ) +check_include_file ( strings.h HAVE_STRINGS_H ) check_include_file ( stdlib.h HAVE_STDLIB_H ) check_include_file ( stdio.h HAVE_STDIO_H ) check_include_file ( math.h HAVE_MATH_H ) diff --git a/src/bindings/fluid_rtkit.c b/src/bindings/fluid_rtkit.c index 55be61498..38fac13f5 100644 --- a/src/bindings/fluid_rtkit.c +++ b/src/bindings/fluid_rtkit.c @@ -25,6 +25,11 @@ SOFTWARE. ***/ +#ifndef _GNU_SOURCE +// required for syscall() +#define _GNU_SOURCE +#endif + #include "fluid_sys.h" #ifdef DBUS_SUPPORT @@ -34,11 +39,6 @@ #if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__DragonFly__) -#ifndef _GNU_SOURCE -#define _GNU_SOURCE - -#endif - #include #include diff --git a/src/drivers/fluid_alsa.c b/src/drivers/fluid_alsa.c index 74911e24c..98ae8f2c0 100644 --- a/src/drivers/fluid_alsa.c +++ b/src/drivers/fluid_alsa.c @@ -34,7 +34,7 @@ #define ALSA_PCM_NEW_HW_PARAMS_API #include -#include +#include #include #include "fluid_lash.h" diff --git a/src/drivers/fluid_oss.c b/src/drivers/fluid_oss.c index f9546c8a0..8b000be26 100644 --- a/src/drivers/fluid_oss.c +++ b/src/drivers/fluid_oss.c @@ -47,7 +47,7 @@ #include #include #include -#include +#include #define BUFFER_LENGTH 512 diff --git a/src/sfloader/fluid_sfont.c b/src/sfloader/fluid_sfont.c index 7b02d2f13..00423c003 100644 --- a/src/sfloader/fluid_sfont.c +++ b/src/sfloader/fluid_sfont.c @@ -46,9 +46,9 @@ fluid_long_long_t default_ftell(void *handle) } #ifdef _WIN32 - #define PRIi64 "%I64d" +#define FLUID_PRIi64 "I64d" #else - #define PRIi64 "%lld" +#define FLUID_PRIi64 "lld" #endif int safe_fread(void *buf, fluid_long_long_t count, void *fd) @@ -57,7 +57,7 @@ int safe_fread(void *buf, fluid_long_long_t count, void *fd) { if(feof((FILE *)fd)) { - FLUID_LOG(FLUID_ERR, "EOF while attempting to read " PRIi64 " bytes", count); + FLUID_LOG(FLUID_ERR, "EOF while attempting to read %" FLUID_PRIi64 " bytes", count); } else { @@ -74,14 +74,14 @@ int safe_fseek(void *fd, fluid_long_long_t ofs, int whence) { if(FLUID_FSEEK((FILE *)fd, ofs, whence) != 0) { - FLUID_LOG(FLUID_ERR, "File seek failed with offset = " PRIi64 " and whence = %d", ofs, whence); + FLUID_LOG(FLUID_ERR, "File seek failed with offset = %" FLUID_PRIi64 " and whence = %d", ofs, whence); return FLUID_FAILED; } return FLUID_OK; } -#undef PRIi64 +#undef FLUID_PRIi64 /** * Creates a new SoundFont loader. diff --git a/src/synth/fluid_synth.c b/src/synth/fluid_synth.c index 999b5f37f..c33bf930e 100644 --- a/src/synth/fluid_synth.c +++ b/src/synth/fluid_synth.c @@ -290,8 +290,12 @@ static void fluid_synth_init(void) { #ifdef TRAP_ON_FPE + #if !defined(__GLIBC__) && defined(__linux__) + #warning "Trap on FPE is only supported when using glibc!" + #else /* Turn on floating point exception traps */ feenableexcept(FE_DIVBYZERO | FE_OVERFLOW | FE_INVALID); + #endif #endif init_dither(); diff --git a/src/utils/fluidsynth_priv.h b/src/utils/fluidsynth_priv.h index fbcbc6f46..67e97abbd 100644 --- a/src/utils/fluidsynth_priv.h +++ b/src/utils/fluidsynth_priv.h @@ -45,6 +45,9 @@ #include #endif +#if HAVE_STRINGS_H +#include +#endif #include "fluidsynth.h"