Re: 1.5.8 build failure on Solaris 8
Oswald Buddenhagen writes:
> after including the standard headers, alias the standard functions to
> some "namespace-clean" names and undef them afterwards.
>
> #include <unistd.h>
> #define posix_lseek(a,b,c) lseek(a,b,c)
> #ifdef lseek
> # undef lseek
> #endif
Given the '#undef lseek', defining another name isn't necessary. (And
I'd even argue that it's slightly harmful -- you're stepping on yet more
parts of the global namespace, but you still can't use "open" as a name
with external linkage.)
As for the undef itself: as I pointed out, doing that causes nasty
differences between
#include <unistd.h>
#include "mutt_socket.h"
and
#include "mutt_socket.h"
#include <unistd.h>
> open() is a nightmare by itself, because it is a varargs function ...
As long as you're not trying to define a macro that hides the global
open() name (and as long as there's a declaration in scope for it when
you call it) that shouldn't cause any problems.
--
Aaron Crane