On Sun, 2014-01-26 at 19:32 -0500, Michael DePaulo wrote:
> [   52s] pulsecore/.libs/libpulsecore_4.99_la-module.o: In function
> `pa_module_exists':
> [   52s] 
> /home/abuild/rpmbuild/BUILD/pulseaudio-4.99.2/src/pulsecore/module.c:70:
> undefined reference to `rindex'
> [   52s] collect2: error: ld returned 1 exit status

strrchr() does the same thing as rindex(), but is "more standard", so I
changed the rindex() call in module.c to a strrchr() call. Hopefully
mingw32 likes that function. The patch is attached (and I already
applied it to the master branch). Could you try again with this patch?

-- 
Tanu
>From eab0544f230ae4d89d139a9a7af1a7281c40689a Mon Sep 17 00:00:00 2001
From: Tanu Kaskinen <[email protected]>
Date: Mon, 27 Jan 2014 21:00:58 +0200
Subject: [PATCH] module: Replace rindex() with strrchr()

rindex() appears to be "non-standard" to an extent, and it caused a
build failure on mingw32.

>From the man page of rindex(): "POSIX.1-2008 removes the
specifications of index() and rindex(), recommending strchr(3) and
strrchr(3) instead."
---
 src/pulsecore/module.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/pulsecore/module.c b/src/pulsecore/module.c
index c57acac..bee8a20 100644
--- a/src/pulsecore/module.c
+++ b/src/pulsecore/module.c
@@ -67,7 +67,7 @@ bool pa_module_exists(const char *name) {
 
     /* strip .so from the end of name, if present */
     n = pa_xstrdup(name);
-    p = rindex(n, '.');
+    p = strrchr(n, '.');
     if (p && pa_streq(p, PA_SOEXT))
         p[0] = 0;
 
-- 
1.8.3.1

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

Reply via email to