Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix musl-related build issues #1245

Merged
merged 7 commits into from
May 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .azure/Dockerfile.azure-alpine
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion .azure/azure-pipelines-alpine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down
10 changes: 5 additions & 5 deletions src/bindings/fluid_rtkit.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
SOFTWARE.
***/

#ifndef _GNU_SOURCE
// required for syscall()
#define _GNU_SOURCE
#endif

#include "fluid_sys.h"

#ifdef DBUS_SUPPORT
Expand All @@ -34,11 +39,6 @@

#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__DragonFly__)

#ifndef _GNU_SOURCE
#define _GNU_SOURCE

#endif

#include <sys/syscall.h>
#include <sys/resource.h>

Expand Down
2 changes: 1 addition & 1 deletion src/drivers/fluid_alsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

#define ALSA_PCM_NEW_HW_PARAMS_API
#include <alsa/asoundlib.h>
#include <sys/poll.h>
#include <poll.h>
#include <math.h>

#include "fluid_lash.h"
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/fluid_oss.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <sys/poll.h>
#include <poll.h>

#define BUFFER_LENGTH 512

Expand Down
10 changes: 5 additions & 5 deletions src/sfloader/fluid_sfont.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
{
Expand All @@ -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.
Expand Down
4 changes: 4 additions & 0 deletions src/synth/fluid_synth.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
3 changes: 3 additions & 0 deletions src/utils/fluidsynth_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
#include <string.h>
#endif

#if HAVE_STRINGS_H
#include <strings.h>
#endif

#include "fluidsynth.h"

Expand Down