Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: AIX patch



On Jun 19, 10:48pm, Andrej Borsenkow wrote:
} Subject: Re: AIX patch
}
} On Tue, 19 Jun 2001, Bart Schaefer wrote:
} 
} > Linux/gcc apparently has an actual `socklen_t' typedef.  Probably should
} > try that first.
} >
} > +    for zsh_type in socklen_t int "unsigned long" size_t ; do
} 
} I had some considerations for testing for int first. If we hit some really
} broken compiler that does not care about protoype mismatch we better have
} the "most common" case first.

That's an excellent reason for trying int *second*.

If the socklen_t typedef exists, it's almost certainly the right thing to
use.  If it doesn't exist, it won't matter whether the compiler cares for
matching prototypes because it'll be a syntax error.

I strongly suspect that the intersection of compilers that botch up the
matching prototypes with headers that typedef socklen_t is the empty set.

} It defaulted to int before - so let's stick to int as much as
} possible. May be, I'm just plain paranoid. And the whole needs check
} for general prototype support of course.

That raises the question of what SOCKLEN_T gets defined to be when NONE
of the types that are attempted work.  (It also raises the question of
whether we should be testing for HAVE_SOCKLEN_T and providing our own
typedef if not, rather than defining a SOCKLEN_T macro.)  I think the
right way to default to `int' is to fall back on it when the test fails
entirely.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



Messages sorted by: Reverse Date, Date, Thread, Author