ladspa-sink: fix Windows compilation

The macro LADSPA_PATH was defined as a list of directories quoted but
without taking into account that the directory names, specially on
Windows, can contain backslashes that need escaping.

This patch removes the quoted from the macro and uses the C preprocessor
to quote it properly using a helper macro.
This commit is contained in:
Salvador Fandino 2017-10-03 14:27:59 +02:00 committed by Tanu Kaskinen
parent 79ee19bb51
commit 8c22cd54de
2 changed files with 9 additions and 2 deletions

View file

@ -1752,7 +1752,7 @@ module_remap_source_la_LDFLAGS = $(MODULE_LDFLAGS)
module_remap_source_la_LIBADD = $(MODULE_LIBADD) module_remap_source_la_LIBADD = $(MODULE_LIBADD)
module_ladspa_sink_la_SOURCES = modules/module-ladspa-sink.c modules/ladspa.h module_ladspa_sink_la_SOURCES = modules/module-ladspa-sink.c modules/ladspa.h
module_ladspa_sink_la_CFLAGS = -DLADSPA_PATH=\"$(libdir)/ladspa:/usr/local/lib/ladspa:/usr/lib/ladspa:/usr/local/lib64/ladspa:/usr/lib64/ladspa\" $(AM_CFLAGS) $(SERVER_CFLAGS) module_ladspa_sink_la_CFLAGS = -DLADSPA_PATH="$(libdir)/ladspa:/usr/local/lib/ladspa:/usr/lib/ladspa:/usr/local/lib64/ladspa:/usr/lib64/ladspa" $(AM_CFLAGS) $(SERVER_CFLAGS)
module_ladspa_sink_la_LDFLAGS = $(MODULE_LDFLAGS) module_ladspa_sink_la_LDFLAGS = $(MODULE_LDFLAGS)
module_ladspa_sink_la_LIBADD = $(MODULE_LIBADD) $(LIBLTDL) module_ladspa_sink_la_LIBADD = $(MODULE_LIBADD) $(LIBLTDL)

View file

@ -1048,8 +1048,15 @@ int pa__init(pa_module*m) {
u->output = NULL; u->output = NULL;
u->ss = ss; u->ss = ss;
/* If the LADSPA_PATH environment variable is not set, we use the
* LADSPA_PATH preprocessor macro instead. The macro can contain characters
* that need to be escaped (especially on Windows backslashes are common).
* The "#" preprocessor operator helpfully adds the required escaping while
* turning the LADSPA_PATH macro into a string. */
#define QUOTE_MACRO(x) #x
if (!(e = getenv("LADSPA_PATH"))) if (!(e = getenv("LADSPA_PATH")))
e = LADSPA_PATH; e = QUOTE_MACRO(LADSPA_PATH);
#undef QUOTE_MACRO
/* FIXME: This is not exactly thread safe */ /* FIXME: This is not exactly thread safe */
t = pa_xstrdup(lt_dlgetsearchpath()); t = pa_xstrdup(lt_dlgetsearchpath());