So move all of the declarations to the top of the offending function.
This patch includes both of issues (Fixes:), from @jeking3 and
@pprindeville
Fixes: #418Fixes: nmathewson/Libevent#136
Some of our unit tests and sample code need functions and structures
defined in an -internal.h header. But that can freak out OpenSolaris,
where stdio.h wants to define _FILE_OFFSET_BITS unless it's already
defined, and then evconfig-internal.h defines it. Regular users
should never ever use our -internal.h headers, so the solution is
to make sure that if we're going to use them ourselves, we do so
before system headers.
Remeber, win32 has a socket type that's actually a handle, so if
there's a chance that code is run on win32, we can't use "int" as the
socket type.
This isn't a blind search-and-replace: sometimes an fd is really in
fact for a file, and not a socket at all.
This is a bit of an interface doozy, but it's really needed in order
to be able to document this stuff without apologizing it. This patch
does the following renamings:
evbuffercb -> bufferevent_data_cb
everrorcb -> bufferevent_event_cb
EVBUFFER_(READ,WRITE,...) -> BEV_EVENT_(...)
EVBUFFER_(INPUT,OUTPUT) -> bufferevent_get_(input,output)
All the old names are available in event2/bufferevent_compat.h
svn:r1283