bug-gnulib
[Top][All Lists]
Advanced

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

[PATCH] gnulib: Define argv[0] as program_name for error.c on Darwin


From: Richard W.M. Jones
Subject: [PATCH] gnulib: Define argv[0] as program_name for error.c on Darwin
Date: Fri, 13 Feb 2015 11:58:16 +0000

We had a contributor to libguestfs who is trying to get it to
compile on Mac OS X.

One problem is that gnulib's error module requires program_name to be
defined on Mac OS X, although not on Linux.  The reason is that gnulib
doesn't know how to access argv[0] on that platform, so instead it
relies on every gnulib-using program to define that symbol.  This is a
problem for libguestfs since the main program is only an indirect user
of gnulib.

After some experimentation she came up with the attached patch, which
she has tested, and which allows argv[0] to be found by calling a
function `_NSGetArgv' (which of course only exists on OS X).

I hope this patch, or something similar, can be considered for
inclusion in gnulib to help us with the port to OS X.

Rich.




reply via email to

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