[PATCH] Check for existence of asprintf and vasprintf

2017-02-22 Thread Ulf Hermann
Add replacements to libeu.a if they don't exist. Include system.h and link against libeu.a where they are used. Signed-off-by: Ulf Hermann --- ChangeLog | 4 configure.ac | 10 ++ lib/ChangeLog | 10 ++ lib/Makefile.am| 8 l

[PATCH] Check for existence of GNU-style basename()

2017-02-22 Thread Ulf Hermann
If it doesn't exist, add an implementation to libeu.a. Include system.h and link against libeu.a where it is used. Signed-off-by: Ulf Hermann --- ChangeLog | 4 configure.ac | 5 + lib/ChangeLog | 7 +++ lib/Makefil

[PATCH] Define fputs_unlocked to fputs if it is not available

2017-02-22 Thread Ulf Hermann
Using fputs_unlocked over fputs is a nice optimization, but ultimately the result is the same. So, if we don't have fputs_unlocked we can just use fputs instead. Signed-off-by: Ulf Hermann --- ChangeLog | 4 configure.ac | 4 lib/ChangeLog | 5 + lib/system.h | 4 4 file

[PATCH] Check for existence of GNU-style strerror_r

2017-02-22 Thread Ulf Hermann
If we don't have it, we don't translate system error codes to strings in dwfl_error.c. Signed-off-by: Ulf Hermann --- ChangeLog| 4 configure.ac | 2 ++ libdwfl/ChangeLog| 5 + libdwfl/dwfl_error.c | 4 4 files changed, 15 insertions(+) diff --git a/ChangeL

[PATCH] Check for program_invocation_short_name

2017-02-22 Thread Ulf Hermann
If it doesn't exist use "" as generic replacement. Signed-off-by: Ulf Hermann --- ChangeLog | 4 configure.ac | 5 + lib/ChangeLog | 5 + lib/system.h | 4 src/ChangeLog | 4 src/elfcmp.c | 1 + 6 files changed, 23 insertions(+) diff --git a/ChangeLog b/ChangeLog i

Re: [PATCH] Check for existence of asprintf and vasprintf

2017-02-22 Thread Mike Frysinger
On 22 Feb 2017 13:50, Ulf Hermann wrote: > Add replacements to libeu.a if they don't exist. Include system.h > and link against libeu.a where they are used. these portability replacements are starting to get out of hand -mike signature.asc Description: Digital signature

Re: [PATCH] Check for existence of asprintf and vasprintf

2017-02-22 Thread Ulf Hermann
> these portability replacements are starting to get out of hand > -mike To what extent should elfutils be portable to non-GNU systems? My goal here is to port it to windows while minimizing the amount of external dependencies I have to add. The functions I have replaced so far are so trivial tha

[PATCH v2] Check for existence of GNU-style strerror_r

2017-02-22 Thread Ulf Hermann
If we don't have it, we don't translate system error codes to strings in dwfl_error.c. Signed-off-by: Ulf Hermann --- ChangeLog| 4 configure.ac | 2 ++ libdwfl/ChangeLog| 5 + libdwfl/dwfl_error.c | 4 4 files changed, 15 insertions(+) diff --git a/ChangeL

Re: [PATCH] Check for existence of asprintf and vasprintf

2017-02-22 Thread Mike Frysinger
On 22 Feb 2017 17:01, Ulf Hermann wrote: > > these portability replacements are starting to get out of hand > > To what extent should elfutils be portable to non-GNU systems? My goal here > is to port it to windows while minimizing the amount of external dependencies > I have to add. The functio

Re: [PATCH] Check for existence of asprintf and vasprintf

2017-02-22 Thread Mark Wielaard
On Wed, Feb 22, 2017 at 05:01:51PM +0100, Ulf Hermann wrote: > > these portability replacements are starting to get out of hand > To what extent should elfutils be portable to non-GNU systems? That has never really been a goal. elfutils is specifically for handling ELF files and DWARF data on a GN

Re: [PATCH] Check for existence of asprintf and vasprintf

2017-02-22 Thread Ulf Hermann
> imo, elfutils shouldn't be growing these fallback implementations itself. > if you want to do this stuff, use gnulib instead. > > then there is no ifdef hell in the source files, and you don't have to > worry about testing whether the ifdef's are correct because gnulib did > it all for you. OK,

Re: [PATCH] Check for existence of asprintf and vasprintf

2017-02-22 Thread Mike Frysinger
On 22 Feb 2017 17:45, Ulf Hermann wrote: > > imo, elfutils shouldn't be growing these fallback implementations itself. > > if you want to do this stuff, use gnulib instead. > > > > then there is no ifdef hell in the source files, and you don't have to > > worry about testing whether the ifdef's ar

Re: [PATCH] Check for existence of asprintf and vasprintf

2017-02-22 Thread Ulf Hermann
> sorry, but i don't know what you're talking about. you don't read the > gnulib code/modules directly, you just run gnulib-tool and tell it which > modules to import. it does all the rest for you. > > you want asprintf ? then add it to the list. > modules=( > asprintf > glob >

Re: [PATCH] Check for existence of asprintf and vasprintf

2017-02-22 Thread Mike Frysinger
On 22 Feb 2017 18:43, Ulf Hermann wrote: > > sorry, but i don't know what you're talking about. you don't read the > > gnulib code/modules directly, you just run gnulib-tool and tell it which > > modules to import. it does all the rest for you. > > > > you want asprintf ? then add it to the lis

Re: [PATCH] Check for existence of asprintf and vasprintf

2017-02-22 Thread John Ogness
On 2017-02-22, Mike Frysinger wrote: > you're correct that GNU strerror_r is not handled by gnulib. > that doesn't look like it's too hard to deal with, but it is > something that'd have to be considered. And if someone is going to take the time to implement strerror_r, really the patch should go