PERFORCE change 92494 for review
Robert Watson
rwatson at FreeBSD.org
Mon Feb 27 15:39:50 PST 2006
http://perforce.freebsd.org/chv.cgi?CH=92494
Change 92494 by rwatson at rwatson_peppercorn on 2006/02/27 23:38:56
Use configure to decide what endian includes are available, and
how to use them. Prefer the local sys/endian.h if we've got one
or building without configure (i.e., BSD make in FreeBSD);
otherwise use compat/endian.h. To do that, we need the local
endian.h, which on some systems is machine/endian.h (Darwin,
*BSD), or in plain old endian.h (Linux).
Affected files ...
.. //depot/projects/trustedbsd/openbsm/compat/endian.h#7 edit
.. //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#31 edit
.. //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#36 edit
Differences ...
==== //depot/projects/trustedbsd/openbsm/compat/endian.h#7 (text+ko) ====
@@ -25,22 +25,13 @@
* SUCH DAMAGE.
*
* Derived from FreeBSD src/sys/sys/endian.h:1.6.
- * $P4: //depot/projects/trustedbsd/openbsm/compat/endian.h#6 $
+ * $P4: //depot/projects/trustedbsd/openbsm/compat/endian.h#7 $
*/
#ifndef _COMPAT_ENDIAN_H_
#define _COMPAT_ENDIAN_H_
/*
- * Pick up value of BYTE_ORDER/_BYTE_ORDER if not yet included.
- */
-#ifdef __linux__
-#include <endian.h>
-#else
-#include <machine/endian.h>
-#endif
-
-/*
* Some systems will have the uint/int types defined here already, others
* will need stdint.h.
*/
==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#31 (text+ko) ====
@@ -31,15 +31,31 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#30 $
+ * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#31 $
*/
#include <sys/types.h>
+
+#ifdef HAVE_CONFIG_H
+#include <config/config.h>
#ifdef HAVE_SYS_ENDIAN_H
#include <sys/endian.h>
-#else
+#else /* !HAVE_SYS_ENDIAN_H */
+#ifdef HAVE_MACHINE_ENDIAN_H
+#include <machine/endian.h>
+#else /* !HAVE_MACHINE_ENDIAN_H */
+#ifdef HAVE_ENDIAN_H
+#include <endian.h>
+#else /* !HAVE_ENDIAN_H */
+#error "No supported endian.h"
+#endif /* !HAVE_ENDIAN_H */
+#endif /* !HAVE_MACHINE_ENDIAN_H */
#include <compat/endian.h>
-#endif
+#endif /* !HAVE_SYS_ENDIANG_H */
+#else /* !HAVE_CONFIG_H */
+#include <sys/endian.h>
+#endif /* !HAVE_CONFIG_H */
+
#include <sys/stat.h>
#include <sys/socket.h>
==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#36 (text+ko) ====
@@ -30,15 +30,31 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#35 $
+ * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#36 $
*/
#include <sys/types.h>
+
+#ifdef HAVE_CONFIG_H
+#include <config/config.h>
#ifdef HAVE_SYS_ENDIAN_H
#include <sys/endian.h>
-#else
+#else /* !HAVE_SYS_ENDIAN_H */
+#ifdef HAVE_MACHINE_ENDIAN_H
+#include <machine/endian.h>
+#else /* !HAVE_MACHINE_ENDIAN_H */
+#ifdef HAVE_ENDIAN_H
+#include <endian.h>
+#else /* !HAVE_ENDIAN_H */
+#error "No supported endian.h"
+#endif /* !HAVE_ENDIAN_H */
+#endif /* !HAVE_MACHINE_ENDIAN_H */
#include <compat/endian.h>
-#endif
+#endif /* !HAVE_SYS_ENDIANG_H */
+#else /* !HAVE_CONFIG_H */
+#include <sys/endian.h>
+#endif /* !HAVE_CONFIG_H */
+
#include <sys/socket.h>
#include <sys/time.h>
#include <sys/un.h>
More information about the trustedbsd-cvs
mailing list