Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/macppc/stand/fixcoff nbmacppc-fixcoff did not cross...



details:   https://anonhg.NetBSD.org/src/rev/e998ee3fa297
branches:  trunk
changeset: 1021897:e998ee3fa297
user:      cjep <cjep%NetBSD.org@localhost>
date:      Wed Jun 23 20:20:44 2021 +0000

description:
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@

diffstat:

 sys/arch/macppc/stand/fixcoff/fixcoff.c |  23 ++++-------------------
 1 files changed, 4 insertions(+), 19 deletions(-)

diffs (43 lines):

diff -r a29635bee972 -r e998ee3fa297 sys/arch/macppc/stand/fixcoff/fixcoff.c
--- a/sys/arch/macppc/stand/fixcoff/fixcoff.c   Wed Jun 23 18:30:32 2021 +0000
+++ b/sys/arch/macppc/stand/fixcoff/fixcoff.c   Wed Jun 23 20:20:44 2021 +0000
@@ -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



Home | Main Index | Thread Index | Old Index