Andre Poenitz wrote:

> On Tue, May 03, 2005 at 05:03:57PM +0100, Angus Leeming wrote:
>> Does this work for you? (Everything is, of course, fine here.)
> 
> Couldn't you simply
> 
> #define POPEN ::popen
> #define POPEN ::_popen
> #define POPEN bark
> 
> and use
> 
> FILE * inf = POPEN(cmd.c_str(), os::popen_read_mode());
> 
> instead of
> 
> +#if defined (HAVE_POPEN)
> FILE * inf = ::popen(cmd.c_str(), os::popen_read_mode());
> +#elif defined (HAVE__POPEN)
> +     FILE * inf = ::_popen(cmd.c_str(), os::popen_read_mode());
> +#else
> +#error No popen() function.
> +#endif
> 
> in the actual code? At least the 'user' code looks nicer that wy imo and
> we seem to use macros anyway here.

I guess that we could, but I hate messing around with the configure stuff. 
It's trivially easy to get it to spit out HAVE_POPEN into config.h and 
more involved (I'd have to write a function !) to do as you suggest.

It's not as if we've needed too many of these nastinesses after all... 

-- 
Angus

Reply via email to