The new #define in oggdec_filter.c gets rid of the warnings such as
'OV_CALLBACKS_STREAMONLY_NOCLOSE' defined but not used [-Wunused-variable]
on NetBSD. With the patch applied, the code still compiles without
warnings. Tested on Linux, FreeBSD and Linux.
mandir := $(datarootdir)/man/man1
MKDIR_P := mkdir -p
-uname_s := $(shell uname -s 2>/dev/null || echo "UNKNOWN_OS")
-
ifeq ("$(origin O)", "command line")
build_dir := $(O)
else
STRICT_CFLAGS += -fdata-sections -ffunction-sections
STRICT_CFLAGS += -Wstrict-prototypes
STRICT_CFLAGS += -Wshadow
+STRICT_CFLAGS += -Wunused -Wall
LDFLAGS += -Wl,--gc-sections
LDFLAGS += -lubsan
endif
-ifeq ($(uname_s),Linux)
- # these cause warnings on *BSD
- STRICT_CFLAGS += -Wunused -Wall
-endif
cc-option = $(shell \
$(CC) $(1) -Werror -c -x c /dev/null -o /dev/null > /dev/null 2>&1 \
/** \file oggdec_filter.c Paraslash's ogg vorbis decoder. */
#include <regex.h>
+
+/*
+ * The static ogg-vorbis callback structures are only needed on Windows. At
+ * least with vorbistools-1.3.7, they cause warnings on NetBSD-10.0. The
+ * #define below instructs the preprocessor to not define these structures,
+ * avoiding the warnings. See the comment in vorbisfile.h for details.
+ */
+#define OV_EXCLUDE_STATIC_CALLBACKS
#include <vorbis/vorbisfile.h>
#include "para.h"