#include <netinet/in.h> /* For IPv6 macros */
#include <netinet/ip.h> /* For IPTOS macros */
#ifdef HAVE_SYS_UN_H
-# include <sys/un.h> /* For SUN_LEN */
+# include <sys/un.h> /* For sockaddr_un */
#endif
#ifdef HAVE_SYS_BITYPES_H
# include <sys/bitypes.h> /* For u_intXX_t */
#include <unistd.h> /* For STDIN_FILENO, etc */
#include <termios.h> /* Struct winsize */
#include <fcntl.h> /* For O_NONBLOCK */
+#include <openssl/opensslv.h> /* For OPENSSL_VERSION_NUMBER */
/* *-*-nto-qnx needs these headers for strcasecmp and LASTLOG_FILE respectively */
#ifdef HAVE_STRINGS_H
# define HAVE_LONG_LONG_INT 1
#endif
-#ifndef HAVE_SOCKLEN_T
-typedef unsigned int socklen_t;
-# define HAVE_SOCKLEN_T
-#endif /* HAVE_SOCKLEN_T */
+#ifndef HAVE_U_CHAR
+typedef unsigned char u_char;
+# define HAVE_U_CHAR
+#endif /* HAVE_U_CHAR */
#ifndef HAVE_SIZE_T
typedef unsigned int size_t;
#define _PATH_XAUTH XAUTH_PATH
#endif /* XAUTH_PATH */
+/* derived from XF4/xc/lib/dps/Xlibnet.h */
+#ifndef X_UNIX_PATH
+# ifdef __hpux
+# define X_UNIX_PATH "/var/spool/sockets/X11/%u"
+# else
+# define X_UNIX_PATH "/tmp/.X11-unix/X%u"
+# endif
+#endif /* X_UNIX_PATH */
+#define _PATH_UNIX_X X_UNIX_PATH
+
#ifndef _PATH_TTY
# define _PATH_TTY "/dev/tty"
#endif
# define __attribute__(x)
#endif /* !defined(__GNUC__) || (__GNUC__ < 2) */
-#ifndef SUN_LEN
-#define SUN_LEN(su) \
- (sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path))
-#endif /* SUN_LEN */
-
/* *-*-nto-qnx doesn't define this macro in the system headers */
#ifdef MISSING_HOWMANY
# define howmany(x,y) (((x)+((y)-1))/(y))
# define getpgrp() getpgrp(0)
#endif
+/* OPENSSL_free() is Free() in versions before OpenSSL 0.9.6 */
+#if !defined(OPENSSL_VERSION_NUMBER) || (OPENSSL_VERSION_NUMBER < 0x0090600f)
+# define OPENSSL_free(x) Free(x)
+#endif
+
/*
* Define this to use pipes instead of socketpairs for communicating with the
* client program. Socketpairs do not seem to work on all systems.
*
- * configure.in sets this for a few OS's which are known to have problems
+ * configure.ac sets this for a few OS's which are known to have problems
* but you may need to set it yourself
*/
/* #define USE_PIPES 1 */