> On Mon, Mar 2, 2009 at 2:54 PM, Kinkie <gkinkie_at_gmail.com> wrote:
>> This causes problems on Linux: the basename call included in libgen.h
>> takes a non-const argument, and thus has issues when the argument is a
>> string constant and issues warnings which fail the build.
>> The version in string.h instead works.
>>
>> From the comment in Linux' libgen.h:
>>
>> /* Return final component of PATH.
>>
>> Â This is the weird XPG version of this function. Â It sometimes will
>> Â modify its argument. Â Therefore we normally use the GNU version (in
>> Â <string.h>) and only if this header is included make the XPG
>> Â version available under the real name. Â */
>>
>>
>> In other words, including libgen.h in Linux is bad. How to more
>> cleanly detect this and react is not totally clear to me...
>
> Ok, a workable trick may be to use:
> #if !__linux__ && HAVE_LIBGEN_H
> #include <libgen.h>
> #endif
>
> at the top of src/Debug.h
>
Hmm, thanks. I found that as well.
I was going to redefine it for Linux and in absence via the compat library.
Amos
Received on Mon Mar 02 2009 - 22:15:14 MST
This archive was generated by hypermail 2.2.0 : Tue Mar 03 2009 - 12:00:03 MST