From: Ken Raeburn Date: Thu, 28 Apr 2005 09:39:43 +0000 (+0000) Subject: * port-sockets.h: On PalmOS, include autoconf.h and netdb.h, and define X-Git-Tag: ms-bug-test-20060525~270 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e762bf8831528586bb560541de62618e7d9937e9;p=krb5.git * port-sockets.h: On PalmOS, include autoconf.h and netdb.h, and define socklen_t. * socket-utils.h: Include k5-platform.h. (sa2sin, sa2sin6, ss2sa, ss2sin, ss2sin6): Always use inline function form, and use "inline" instead of "__inline__". git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17202 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/include/ChangeLog b/src/include/ChangeLog index 89fee2c50..a4430b90c 100644 --- a/src/include/ChangeLog +++ b/src/include/ChangeLog @@ -1,3 +1,11 @@ +2005-04-28 Ken Raeburn + + * port-sockets.h: On PalmOS, include autoconf.h and netdb.h, and + define socklen_t. + * socket-utils.h: Include k5-platform.h. + (sa2sin, sa2sin6, ss2sa, ss2sin, ss2sin6): Always use inline + function form, and use "inline" instead of "__inline__". + 2005-04-13 Ken Raeburn * k5-int.h: Remove disabled code that used to be part of the diff --git a/src/include/port-sockets.h b/src/include/port-sockets.h index 5a8562dfc..d1cf9e6f9 100644 --- a/src/include/port-sockets.h +++ b/src/include/port-sockets.h @@ -65,11 +65,17 @@ typedef WSABUF sg_buf; #define ETIMEDOUT WSAETIMEDOUT #endif -#else /* not _WIN32 */ +#elif defined(__palmos__) /* If this source file requires it, define struct sockaddr_in (and possibly other things related to network I/O). */ +#include "krb5/autoconf.h" +#include +typedef int socklen_t; + +#else /* UNIX variants */ + #include "krb5/autoconf.h" #include diff --git a/src/include/socket-utils.h b/src/include/socket-utils.h index 62c4d070c..dcd24ebc7 100644 --- a/src/include/socket-utils.h +++ b/src/include/socket-utils.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001 by the Massachusetts Institute of Technology, + * Copyright (C) 2001,2005 by the Massachusetts Institute of Technology, * Cambridge, MA, USA. All Rights Reserved. * * This software is being provided to you, the LICENSEE, by the @@ -54,8 +54,9 @@ #include "krb5/autoconf.h" /* for sockaddr_storage */ #include "port-sockets.h" +/* for "inline" if needed */ +#include "k5-platform.h" -#if defined (__GNUC__) /* * There's a lot of confusion between pointers to different sockaddr * types, and pointers with different degrees of indirection, as in @@ -66,37 +67,30 @@ * The casts to (void *) are to get GCC to shut up about alignment * increasing. */ -static __inline__ struct sockaddr_in *sa2sin (struct sockaddr *sa) +static inline struct sockaddr_in *sa2sin (struct sockaddr *sa) { return (struct sockaddr_in *) (void *) sa; } #ifdef KRB5_USE_INET6 -static __inline__ struct sockaddr_in6 *sa2sin6 (struct sockaddr *sa) +static inline struct sockaddr_in6 *sa2sin6 (struct sockaddr *sa) { return (struct sockaddr_in6 *) (void *) sa; } #endif -static __inline__ struct sockaddr *ss2sa (struct sockaddr_storage *ss) +static inline struct sockaddr *ss2sa (struct sockaddr_storage *ss) { return (struct sockaddr *) ss; } -static __inline__ struct sockaddr_in *ss2sin (struct sockaddr_storage *ss) +static inline struct sockaddr_in *ss2sin (struct sockaddr_storage *ss) { return (struct sockaddr_in *) ss; } #ifdef KRB5_USE_INET6 -static __inline__ struct sockaddr_in6 *ss2sin6 (struct sockaddr_storage *ss) +static inline struct sockaddr_in6 *ss2sin6 (struct sockaddr_storage *ss) { return (struct sockaddr_in6 *) ss; } #endif -#else -#define sa2sin(S) ((struct sockaddr_in *)(S)) -#define sa2sin6(S) ((struct sockaddr_in6 *)(S)) -#define ss2sa(S) ((struct sockaddr *)(S)) -#define ss2sin(S) ((struct sockaddr_in *)(S)) -#define ss2sin6(S) ((struct sockaddr_in6 *)(S)) -#endif #if !defined (socklen) /* socklen_t socklen (struct sockaddr *) */