summaryrefslogtreecommitdiff
path: root/usr/src/lib/krb5/db2/include
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/lib/krb5/db2/include')
-rw-r--r--usr/src/lib/krb5/db2/include/db-int.h97
-rw-r--r--usr/src/lib/krb5/db2/include/db-queue.h8
2 files changed, 92 insertions, 13 deletions
diff --git a/usr/src/lib/krb5/db2/include/db-int.h b/usr/src/lib/krb5/db2/include/db-int.h
index 37f6a0a377..c5c43a481a 100644
--- a/usr/src/lib/krb5/db2/include/db-int.h
+++ b/usr/src/lib/krb5/db2/include/db-int.h
@@ -1,5 +1,5 @@
/*
- * Copyright 1997-2002 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -52,22 +52,91 @@ extern "C" {
#include <db.h>
-/* deal with autoconf-based stuff (db.h includes db-config.h) */
+/* deal with autoconf-based stuff */
-#ifndef HAVE_MEMMOVE
-#define memmove my_memmove
+#define DB_LITTLE_ENDIAN 1234
+#define DB_BIG_ENDIAN 4321
+
+#include <stdlib.h>
+#ifdef HAVE_ENDIAN_H
+# include <endian.h>
+#endif
+#ifdef HAVE_MACHINE_ENDIAN_H
+# include <machine/endian.h>
+#endif
+#ifdef HAVE_SYS_PARAM_H
+# include <sys/param.h>
#endif
-#ifndef HAVE_MKSTEMP
-#define mkstemp my_mkstemp
+/* SUNW14resync:
+ The following code is disabled as it correctly determines the
+ endianness of the system. This would break backward compatability
+ for x86 as prior to this resync all architectures are treated
+ similarily - as big endian. See definition of "WORDS_BIGENDIAN" in
+ db-config.h.
+*/
+#if 0
+/* Handle both BIG and LITTLE defined and BYTE_ORDER matches one, or
+ just one defined; both with and without leading underscores.
+
+ Ignore "PDP endian" machines, this code doesn't support them
+ anyways. */
+#if !defined(LITTLE_ENDIAN) && !defined(BIG_ENDIAN) && !defined(BYTE_ORDER)
+# ifdef __LITTLE_ENDIAN__
+# define LITTLE_ENDIAN __LITTLE_ENDIAN__
+# endif
+# ifdef __BIG_ENDIAN__
+# define BIG_ENDIAN __BIG_ENDIAN__
+# endif
+#endif
+#if !defined(LITTLE_ENDIAN) && !defined(BIG_ENDIAN) && !defined(BYTE_ORDER)
+# ifdef _LITTLE_ENDIAN
+# define LITTLE_ENDIAN _LITTLE_ENDIAN
+# endif
+# ifdef _BIG_ENDIAN
+# define BIG_ENDIAN _BIG_ENDIAN
+# endif
+# ifdef _BYTE_ORDER
+# define BYTE_ORDER _BYTE_ORDER
+# endif
+#endif
+#if !defined(LITTLE_ENDIAN) && !defined(BIG_ENDIAN) && !defined(BYTE_ORDER)
+# ifdef __LITTLE_ENDIAN
+# define LITTLE_ENDIAN __LITTLE_ENDIAN
+# endif
+# ifdef __BIG_ENDIAN
+# define BIG_ENDIAN __BIG_ENDIAN
+# endif
+# ifdef __BYTE_ORDER
+# define BYTE_ORDER __BYTE_ORDER
+# endif
+#endif
+
+#if defined(_MIPSEL) && !defined(LITTLE_ENDIAN)
+# define LITTLE_ENDIAN
+#endif
+#if defined(_MIPSEB) && !defined(BIG_ENDIAN)
+# define BIG_ENDIAN
+#endif
+
+#if defined(LITTLE_ENDIAN) && defined(BIG_ENDIAN) && defined(BYTE_ORDER)
+# if LITTLE_ENDIAN == BYTE_ORDER
+# define DB_BYTE_ORDER DB_LITTLE_ENDIAN
+# elif BIG_ENDIAN == BYTE_ORDER
+# define DB_BYTE_ORDER DB_BIG_ENDIAN
+# else
+# error "LITTLE_ENDIAN and BIG_ENDIAN defined, but can't determine byte order"
+# endif
+#elif defined(LITTLE_ENDIAN) && !defined(BIG_ENDIAN)
+# define DB_BYTE_ORDER DB_LITTLE_ENDIAN
+#elif defined(BIG_ENDIAN) && !defined(LITTLE_ENDIAN)
+# define DB_BYTE_ORDER DB_BIG_ENDIAN
+#else
+# error "can't determine byte order from included system headers"
#endif
-#ifndef HAVE_STRERROR
-#define strerror my_strerror
#endif
-#define DB_LITTLE_ENDIAN 1234
-#define DB_BIG_ENDIAN 4321
#ifdef WORDS_BIGENDIAN
#define DB_BYTE_ORDER DB_BIG_ENDIAN
@@ -86,6 +155,13 @@ extern "C" {
#include <fcntl.h>
#include <stdio.h>
#include <errno.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+/* Tru64 5.1: int8_t is defined here, and stdint.h doesn't exist. */
+#include <inttypes.h>
+#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/param.h>
@@ -227,7 +303,6 @@ void __dbpanic __P((DB *dbp));
#ifndef O_BINARY
#define O_BINARY 0 /* Needed for Win32 compiles */
#endif
-
#endif /* _DB_INT_H_ */
#ifdef __cplusplus
diff --git a/usr/src/lib/krb5/db2/include/db-queue.h b/usr/src/lib/krb5/db2/include/db-queue.h
index 6f09a66805..983c444d59 100644
--- a/usr/src/lib/krb5/db2/include/db-queue.h
+++ b/usr/src/lib/krb5/db2/include/db-queue.h
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 1997-2000 by Sun Microsystems, Inc.
- * All rights reserved.
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
*/
#ifndef _KRB5_DB2_DBQUEUE_H
@@ -47,6 +47,9 @@ extern "C" {
* @(#)queue.h 8.3 (Berkeley) 12/13/93
*/
+#ifndef _QUEUE_H_
+#define _QUEUE_H_
+
/*
* This file defines three types of data structures: lists, tail queues,
* and circular queues.
@@ -253,6 +256,7 @@ struct { \
(elm)->field.cqe_prev->field.cqe_next = \
(elm)->field.cqe_next; \
}
+#endif /* !_QUEUE_H_ */
#ifdef __cplusplus
}