On Sun, Dec 9, 2012 at 11:57 AM, John David Anglin <d...@hiauly1.hia.nrc.ca> wrote: > > #ifndef HAVE_GETEXECNAME > +#if defined(__hpux) && (defined(__ia64) || defined(_LP64)) > +#include <dlfcn.h> > +#define getexecname getexecname_hpux > + > +static char * > +getexecname_hpux (void) > +{ > + struct load_module_desc desc; > + > + dlget(-2, &desc, sizeof(desc)); > + return dlgetname(&desc, sizeof(desc), NULL, 0, 0); > +} > +
This is the kind of thing that is normally done via configure tests rather than #ifdef tests. And once the configure tests are written, I would prefer to see this as another pass in fileline.c, rather than this rather complex reuse of getexecname. Ian