bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

symbol namespace collisions (was: Re: memrchr speed)


From: Simon Josefsson
Subject: symbol namespace collisions (was: Re: memrchr speed)
Date: Mon, 28 Apr 2008 16:26:49 +0200
User-agent: Gnus/5.110009 (No Gnus v0.9) Emacs/22.2 (gnu/linux)

Bruno Haible <address@hidden> writes:

> Also, the memrchr module does not support the renaming in config.h that
> is used to guarantee namespace cleanliness of shared libraries. E.g.
>   #define memrchr libfoo_memrchr

Interesting, are you using such renaming in some project?  Can gnulib
generate these re-defines automatically, or do you maintain them
manually?  How do you test that they work, or know which symbols you
need to rename?

When building static libraries for my projects I run into name-space
collisions (e.g., asprintf implemented both by libfoo and libbar).  I
haven't had a good solution to this so far, but it seems to come up more
and more often so fixing this would be nice.

/Simon

> Fixed like this:
>
>
> 2008-04-27  Bruno Haible  <address@hidden>
>
>       Allow local renaming in config.h.
>       * lib/memrchr.c (memrchr): Don't undefine outside libc.
>
> --- lib/memrchr.c.orig        2008-04-27 12:27:02.000000000 +0200
> +++ lib/memrchr.c     2008-04-27 12:26:16.000000000 +0200
> @@ -35,7 +35,9 @@
>  #include "intprops.h"
>  
>  #undef __memrchr
> -#undef memrchr
> +#ifdef _LIBC
> +# undef memrchr
> +#endif
>  
>  #ifndef weak_alias
>  # define __memrchr memrchr




reply via email to

[Prev in Thread] Current Thread [Next in Thread]