A couple of patches for fixing compilation errors on Windows.
From cd390803331dbca5b7d05484611e6c04af57b7b5 Mon Sep 17 00:00:00 2001
From: Salvador Fandino <[email protected]>
Date: Tue, 3 Oct 2017 12:58:57 +0200
Subject: [PATCH 1/2] core: fix compilation on Windows without NLS

Under MinGW, LC_MESSAGES is defined in libint.h which is not
included when pulseaudio is configured with nls disabled.

LC_MESSAGES is referenced when setting PA_PROP_APPLICATION_LANGUAGE.

This patch just disables setting that property when ENABLE_NLS
is not defined.
---
 src/pulsecore/proplist-util.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/pulsecore/proplist-util.c b/src/pulsecore/proplist-util.c
index baf683da..f966579b 100644
--- a/src/pulsecore/proplist-util.c
+++ b/src/pulsecore/proplist-util.c
@@ -207,12 +207,14 @@ void pa_init_proplist(pa_proplist *p) {
             pa_proplist_sets(p, PA_PROP_APPLICATION_NAME, t);
     }
 
+#ifdef ENABLE_NLS
     if (!pa_proplist_contains(p, PA_PROP_APPLICATION_LANGUAGE)) {
         const char *l;
 
         if ((l = setlocale(LC_MESSAGES, NULL)))
             pa_proplist_sets(p, PA_PROP_APPLICATION_LANGUAGE, l);
     }
+#endif
 
     if (!pa_proplist_contains(p, PA_PROP_WINDOW_X11_DISPLAY)) {
         const char *t;
-- 
2.14.1

From 2f779b406d9013d9688ef95b886b35579599716d Mon Sep 17 00:00:00 2001
From: Salvador Fandino <[email protected]>
Date: Tue, 3 Oct 2017 14:27:59 +0200
Subject: [PATCH 2/2] 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.
---
 src/Makefile.am                  | 2 +-
 src/modules/module-ladspa-sink.c | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index d7a551e2..e610db74 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1752,7 +1752,7 @@ module_remap_source_la_LDFLAGS = $(MODULE_LDFLAGS)
 module_remap_source_la_LIBADD = $(MODULE_LIBADD)
 
 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_LIBADD = $(MODULE_LIBADD) $(LIBLTDL)
 
diff --git a/src/modules/module-ladspa-sink.c b/src/modules/module-ladspa-sink.c
index c2c7c85d..feb9faee 100644
--- a/src/modules/module-ladspa-sink.c
+++ b/src/modules/module-ladspa-sink.c
@@ -1048,8 +1048,10 @@ int pa__init(pa_module*m) {
     u->output = NULL;
     u->ss = ss;
 
+#define QUOTE_MACRO(x) #x
     if (!(e = getenv("LADSPA_PATH")))
-        e = LADSPA_PATH;
+        e = QUOTE_MACRO(LADSPA_PATH);
+#undef QUOTE_MACRO
 
     /* FIXME: This is not exactly thread safe */
     t = pa_xstrdup(lt_dlgetsearchpath());
-- 
2.14.1

_______________________________________________
pulseaudio-discuss mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss

Reply via email to