compat: add proper work-around for missing strndup
commit52c124bf08714bd45368f99a0bcfced2ce641f17
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>
Thu, 8 Aug 2013 14:43:03 +0000 (8 10:43 -0400)
committerVivien Didelot <vivien.didelot@savoirfairelinux.com>
Tue, 6 May 2014 03:20:51 +0000 (5 23:20 -0400)
treef11f55b1dece2c2b9c97cc3dc57474c7150b559d
parent683130e75801e97ddc66d1b41748f4301e878cee
compat: add proper work-around for missing strndup

Some plaforms (such as OSX 10.6) lack the strndup() function.

This patch borrows and adapts the strndup.c code from the libiberty. The
work-around can be enabled via configure (and config.make.in), via the
config.make file by adding the line 'NO_STRNDUP=y' or when calling make
by adding 'NO_STRNDUP=y' to its parameter list.

Fixes #286

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Makefile
compat/compat.h
compat/strndup.c [new file with mode: 0644]
config.make.in
configure.ac