Module Name: src
Committed By: cjep
Date: Wed Jun 23 20:20:44 UTC 2021
Modified Files:
src/sys/arch/macppc/stand/fixcoff: fixcoff.c
Log Message:
nbmacppc-fixcoff did not cross-build correctly on OpenBSD because
fixcoff.c had its own definition of htobe16. The toolchain
already handles this. Now builds on OpenBSD. Checked on NetBSD, Darwin &
Linux.
Discussed with uwe@
To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/macppc/stand/fixcoff/fixcoff.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/macppc/stand/fixcoff/fixcoff.c
diff -u src/sys/arch/macppc/stand/fixcoff/fixcoff.c:1.11 src/sys/arch/macppc/stand/fixcoff/fixcoff.c:1.12
--- src/sys/arch/macppc/stand/fixcoff/fixcoff.c:1.11 Sat Mar 14 15:36:09 2009
+++ src/sys/arch/macppc/stand/fixcoff/fixcoff.c Wed Jun 23 20:20:44 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: fixcoff.c,v 1.11 2009/03/14 15:36:09 dsl Exp $ */
+/* $NetBSD: fixcoff.c,v 1.12 2021/06/23 20:20:44 cjep Exp $ */
/*
* Copyright (c) 1999 National Aeronautics & Space Administration
@@ -43,30 +43,15 @@
#if HAVE_NBTOOL_CONFIG_H
#include "nbtool_config.h"
-#endif
+#else /* HAVE_NBTOOL_CONFIG_H */
+#include <sys/endian.h>
+#endif /* HAVE_NBTOOL_CONFIG_H */
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
-#if HAVE_NBTOOL_CONFIG_H
-
-#if WORDS_BIGENDIAN
-#define htobe16(x) (x)
-#else
-static unsigned short
-__htobe16(unsigned short x)
-{
- return (((x & 0xff00) >> 8) | ((x & 0x00ff) << 8));
-}
-#define htobe16(x) __htobe16(x)
-#endif /* WORDS_BIGENDIAN */
-
-#else /* HAVE_NBTOOL_CONFIG_H */
-#include <sys/endian.h>
-#endif /* HAVE_NBTOOL_CONFIG_H */
-
struct filehdr {
#define U802WRMAGIC 0730
#define U802ROMAGIC 0735