From d97135d5eff1c52eee49395b34a3dafe056c3db6 Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Tue, 23 May 1995 19:34:44 +0000 Subject: [PATCH] k5-config.h, k5-sockets.h: Move the sockets specific setup out of k5-config.h to k5-sockets.h, and modify k5-int to include k5-sockets.h (if it is requested by NEED_SOCKETS) after including krb5.h. This keeps the gdb type numbers the same across .o files, so that recent binuntils can compress the debugging information in executables linked with a debugging library. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5849 dc483132-0cff-0310-8789-dd5450dbe970 --- src/include/krb5/ChangeLog | 9 ++++ src/include/krb5/k5-config.h | 72 -------------------------- src/include/krb5/k5-sockets.h | 95 +++++++++++++++++++++++++++++++++++ 3 files changed, 104 insertions(+), 72 deletions(-) create mode 100644 src/include/krb5/k5-sockets.h diff --git a/src/include/krb5/ChangeLog b/src/include/krb5/ChangeLog index b0f9d15b7..ea3a2260b 100644 --- a/src/include/krb5/ChangeLog +++ b/src/include/krb5/ChangeLog @@ -1,3 +1,12 @@ +Tue May 23 15:33:00 1995 Theodore Y. Ts'o (tytso@dcl) + + * k5-config.h, k5-sockets.h: Move the sockets specific setup out + of k5-config.h to k5-sockets.h, and modify k5-int to + include k5-sockets.h (if it is requested by + NEED_SOCKETS) after including krb5.h. This keeps the + gdb type numbers the same across .o files, so that + recent binuntils can compress the debugging information + in executables linked with a debugging library. Mon May 22 09:41:39 EDT 1995 Paul Park (pjpark@mit.edu) * Makefile.in - (install) Always perform install actions using diff --git a/src/include/krb5/k5-config.h b/src/include/krb5/k5-config.h index a4d24c3d6..82a4ddf3c 100644 --- a/src/include/krb5/k5-config.h +++ b/src/include/krb5/k5-config.h @@ -104,24 +104,6 @@ typedef unsigned char u_char; #include #endif -#ifdef NEED_SOCKETS -#include - -/* Some of our own infrastructure where the WinSock stuff was too hairy - to dump into a clean Unix program... */ - -#define SOCKET_INITIALIZE() win_socket_initialize() -#define SOCKET_CLEANUP() WSACleanup() -#define SOCKET_ERRNO (WSAGetLastError()) -#define SOCKET_SET_ERRNO(x) (WSASetLastError (x)) -#define SOCKET_NFDS(f) (0) /* select()'s first arg is ignored */ -#define SOCKET_READ(fd, b, l) (recv(fd, b, l, 0)) -#define SOCKET_WRITE(fd, b, l) (send(fd, b, l, 0)) -#define SOCKET_EINTR WSAEINTR - -int win_socket_initialize(); -#endif - #ifdef NEED_LOWLEVEL_IO /* Ugly. Microsoft, in stdc mode, doesn't support the low-level i/o * routines directly. Rather, they only export the _ version. @@ -260,60 +242,6 @@ typedef unsigned char u_char; #define labs(x) abs(x) #endif - -#ifdef NEED_SOCKETS -/* If this source file requires it, define struct sockaddr_in - (and possibly other things related to network I/O). */ - -#ifdef HAVE_MACSOCK_H /* Sockets stuff differs on Mac */ -#include "macsock.h" /* Macintosh sockets emulation library */ - -/* Some of our own infrastructure where the WinSock stuff was too hairy - to dump into a clean Unix program... */ - -#define SOCKET_INITIALIZE() (WSAStartup(0x0101, (WSADATA *)0)) -#define SOCKET_CLEANUP() (WSACleanup()) -#define SOCKET_ERRNO (WSAGetLastError()) -#define SOCKET_SET_ERRNO(x) (WSASetLastError(x)) -#define SOCKET_NFDS(f) (0) /* select()'s first arg is ignored */ -#define SOCKET_READ(fd, b, l) (recv(fd, b, l, 0)) -#define SOCKET_WRITE(fd, b, l) (send(fd, b, l, 0)) -#define SOCKET_EINTR WSAEINTR - -#else /* HAVE_MACSOCK_H */ /* Sockets stuff for Unix machines */ - -#include /* For struct sockaddr_in and in_addr */ -#include /* For inet_ntoa */ -#include /* For struct hostent, gethostbyname, etc */ -#include /* For MAXHOSTNAMELEN */ -#include /* For SOCK_*, AF_*, etc */ -#include /* For struct timeval */ -#include /* For struct ifconf, for localaddr.c */ - -/* - * Compatability with WinSock calls on MS-Windows... - */ -#define SOCKET unsigned int -#define INVALID_SOCKET ((SOCKET)~0) -#define closesocket close -#define ioctlsocket ioctl -#define SOCKET_ERROR (-1) - -/* Some of our own infrastructure where the WinSock stuff was too hairy - to dump into a clean Unix program... */ - -#define SOCKET_INITIALIZE() (0) /* No error (or anything else) */ -#define SOCKET_CLEANUP() /* nothing */ -#define SOCKET_ERRNO errno -#define SOCKET_SET_ERRNO(x) (errno = (x)) -#define SOCKET_NFDS(f) ((f)+1) /* select() arg for a single fd */ -#define SOCKET_READ read -#define SOCKET_WRITE write -#define SOCKET_EINTR EINTR - -#endif /* HAVE_MACSOCK_H */ -#endif /* NEED_SOCKETS */ - #endif /* _MSDOS */ #endif /* KRB5_CONFIG__ */ diff --git a/src/include/krb5/k5-sockets.h b/src/include/krb5/k5-sockets.h new file mode 100644 index 000000000..87ace3e47 --- /dev/null +++ b/src/include/krb5/k5-sockets.h @@ -0,0 +1,95 @@ +/* + * Copyright 1990,1991,1994,1995 by the Massachusetts Institute of Technology. + * All Rights Reserved. + * + * Export of this software from the United States of America may + * require a specific license from the United States Government. + * It is the responsibility of any person or organization contemplating + * export to obtain such a license before exporting. + * + * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and + * distribute this software and its documentation for any purpose and + * without fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright notice and + * this permission notice appear in supporting documentation, and that + * the name of M.I.T. not be used in advertising or publicity pertaining + * to distribution of the software without specific, written prior + * permission. M.I.T. makes no representations about the suitability of + * this software for any purpose. It is provided "as is" without express + * or implied warranty. + * + * Sockets interface header file + */ + +#ifdef _MSDOS + +#include + +/* Some of our own infrastructure where the WinSock stuff was too hairy + to dump into a clean Unix program... */ + +#define SOCKET_INITIALIZE() win_socket_initialize() +#define SOCKET_CLEANUP() WSACleanup() +#define SOCKET_ERRNO (WSAGetLastError()) +#define SOCKET_SET_ERRNO(x) (WSASetLastError (x)) +#define SOCKET_NFDS(f) (0) /* select()'s first arg is ignored */ +#define SOCKET_READ(fd, b, l) (recv(fd, b, l, 0)) +#define SOCKET_WRITE(fd, b, l) (send(fd, b, l, 0)) +#define SOCKET_EINTR WSAEINTR + +int win_socket_initialize(); + +#else /* not _MSDOS */ + +/* If this source file requires it, define struct sockaddr_in + (and possibly other things related to network I/O). */ + +#ifdef HAVE_MACSOCK_H /* Sockets stuff differs on Mac */ +#include "macsock.h" /* Macintosh sockets emulation library */ + +/* Some of our own infrastructure where the WinSock stuff was too hairy + to dump into a clean Unix program... */ + +#define SOCKET_INITIALIZE() (WSAStartup(0x0101, (WSADATA *)0)) +#define SOCKET_CLEANUP() (WSACleanup()) +#define SOCKET_ERRNO (WSAGetLastError()) +#define SOCKET_SET_ERRNO(x) (WSASetLastError(x)) +#define SOCKET_NFDS(f) (0) /* select()'s first arg is ignored */ +#define SOCKET_READ(fd, b, l) (recv(fd, b, l, 0)) +#define SOCKET_WRITE(fd, b, l) (send(fd, b, l, 0)) +#define SOCKET_EINTR WSAEINTR + +#else /* ! HAVE_MACSOCK_H */ /* Sockets stuff for Unix machines */ + +#include /* For struct sockaddr_in and in_addr */ +#include /* For inet_ntoa */ +#include /* For struct hostent, gethostbyname, etc */ +#include /* For MAXHOSTNAMELEN */ +#include /* For SOCK_*, AF_*, etc */ +#include /* For struct timeval */ +#include /* For struct ifconf, for localaddr.c */ + +/* + * Compatability with WinSock calls on MS-Windows... + */ +#define SOCKET unsigned int +#define INVALID_SOCKET ((SOCKET)~0) +#define closesocket close +#define ioctlsocket ioctl +#define SOCKET_ERROR (-1) + +/* Some of our own infrastructure where the WinSock stuff was too hairy + to dump into a clean Unix program... */ + +#define SOCKET_INITIALIZE() (0) /* No error (or anything else) */ +#define SOCKET_CLEANUP() /* nothing */ +#define SOCKET_ERRNO errno +#define SOCKET_SET_ERRNO(x) (errno = (x)) +#define SOCKET_NFDS(f) ((f)+1) /* select() arg for a single fd */ +#define SOCKET_READ read +#define SOCKET_WRITE write +#define SOCKET_EINTR EINTR + +#endif /* HAVE_MACSOCK_H */ + +#endif /* _MSDOS */ -- 2.26.2