1.1.43 build err on OS X

Neil Spring nspring@cs.washington.edu
Thu, 4 Sep 2003 12:35:48 -0700


--Apple-Mail-14-645096003
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII; format=flowed


The new src/ath.h declares interfaces using socklen_t, which is not 
present on OS X, so the build fails.

When I use socklen_t in my code, I use the following autoconf macro 
from: http://www.hlrs.de/people/keller/configure_scripts.html

AC_DEFUN([AC_TYPE_SOCKLEN_T], [
   dnl Since the old-style (autoconf 2.13) macro AC_CHECK_TYPE(type, 
replacement)
   dnl only checks in <sys/types.h> we have to be more awkward:
   dnl We have to check for socklen_t in <sys/types.h> -- if it's not 
defined
   dnl there, we also look in <sys/socket.h> (a more common place)
   AC_CHECK_TYPE(socklen_t,,
     AC_DEFINE(socklen_t, int, [Define to `int' if neither <sys/types.h> 
nor <sys/socket.h> define.]),
     [
#include <sys/types.h>
#include <sys/socket.h>
   ])
])

An alternate, though less aesthetically pleasing, solution would be to 
simply use "int".

The errors are exactly as one would expect (though the line numbers are 
a bit off as I tried adding some includes):

gcc -DHAVE_CONFIG_H -I. -I. -I.. -I/sw/include -I/sw/include -g -O2 
-Wall -c ath-compat.c -Wp,-MD,.deps/ath-compat.TPlo  -fno-common -DPIC 
-o .libs/ath-compat.lo
ath.h:69: undefined type, found `socklen_t'
ath.h:70: undefined type, found `socklen_t'
ath.h:87: undefined type, found `socklen_t'
ath.h:88: undefined type, found `socklen_t'
ath-compat.c:148: undefined type, found `socklen_t'
ath-compat.c:158: undefined type, found `socklen_t'
cpp-precomp: warning: errors during smart preprocessing, retrying in 
basic mode
In file included from ath-compat.c:35:
ath.h:69: parse error before "socklen_t"
ath.h:70: parse error before "socklen_t"
ath.h:87: parse error before "socklen_t"
ath.h:88: parse error before "socklen_t"
ath-compat.c:148: parse error before "socklen_t"
ath-compat.c: In function `_gcry_ath_accept':
ath-compat.c:151: `s' undeclared (first use in this function)
ath-compat.c:151: (Each undeclared identifier is reported only once
ath-compat.c:151: for each function it appears in.)
ath-compat.c:151: `addr' undeclared (first use in this function)
ath-compat.c:151: `length_ptr' undeclared (first use in this function)
ath-compat.c: At top level:
ath-compat.c:158: parse error before "socklen_t"
ath-compat.c: In function `_gcry_ath_connect':
ath-compat.c:161: `s' undeclared (first use in this function)
ath-compat.c:161: `addr' undeclared (first use in this function)
ath-compat.c:161: `length' undeclared (first use in this function)
make: *** [ath-compat.lo] Error 1

Let me know when you'd like me to try a build from CVS.

thanks,
-neil

--Apple-Mail-14-645096003
content-type: application/pgp-signature; x-mac-type=70674453;
	name=PGP.sig
content-disposition: inline
content-transfer-encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (Darwin)

iD8DBQE/V5QftvhXVvuQ3oQRAvKOAKCA45Or4PflET33PL6izNHjkNGwCgCcD8Jr
755GOxTkXkNQdXI4xR237yY=
=3rTc
-----END PGP SIGNATURE-----

--Apple-Mail-14-645096003--