Subject: pkg/22829: games/level9 doesn't work on big endian machines
To: None <gnats-bugs@gnats.netbsd.org>
From: Lloyd Parkes <lloyd@must-have-coffee.gen.nz>
List: netbsd-bugs
Date: 09/17/2003 21:08:13
>Number:         22829
>Category:       pkg
>Synopsis:       games/level9 doesn't work on big endian machines
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Sep 17 09:09:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Lloyd Parkes
>Release:        NetBSD 1.6.1_STABLE
>Organization:
Must Have Coffee
>Environment:
System: NetBSD archangel.must-have-coffee.gen.nz 1.6.1_STABLE NetBSD 1.6.1_STABLE (GENERIC) #0: Tue Jul 15 17:28:29 NZST 2003 lloyd@archangel.must-have-coffee.gen.nz:/vol/build/NetBSD/sparc64/obj/sys/arch/sparc64/compile/GENERIC sparc64
Architecture: sparc64
Machine: sparc64
>Description:

The program contains an runtime endianness check that needs to be
configured manually at compile time. This check causes the program to
abort, but the check is not used. i.e. it is obsolete.

>How-To-Repeat:

Build the level 9 interpreter on a sparc box.

>Fix:

This patch is relative to WRKSRC and is suitable as patches/patch-aa

$NetBSD$

--- unix-curses.c.orig	Wed Sep 17 20:53:54 2003
+++ unix-curses.c	Wed Sep 17 20:54:37 2003
@@ -10,11 +10,6 @@
  *
  * A few notes on this port:
  *
- * I've modified level9.h to use the LITTLEENDIAN macro -- it assumes this if
- *  you're using DOS or Windows, otherwise it uses the byte sex macros. This
- *  shouldn't hurt a little-endian machine (Intel), but you must undefine
- *  LITTLEENDIAN if you've got a Motorola-type machine.
- *
  * If you don't specify a path, level9 Linux will look first in the directory
  *  $LEVEL9DIR, if defined, and then in the current directory.
  *
@@ -39,11 +34,6 @@
 #define FILE_DELIM   '/'
 
 /*
- * Set this if you are compiling on a little-endian machine (ARM, Intel)
- */
-#define LITTLEENDIAN 1
-
-/*
  * Define this as 1 to get the Emacs-type key bindings
  *  Ctrl-A (go to beginning of line)
  *  Ctrl-B (back one character)
@@ -745,21 +735,6 @@
   /*
    * Check byte sex
    */
-# if LITTLEENDIAN
-  L9UINT32 test = 0x12345678;
-  char *tcp = (char *) &test;
-# else
-  L9UINT32 test = 0x78563412;
-  char *tcp = (char *) &test;
-# endif
-  if ((tcp [0] != 0x78) || (tcp [1] != 0x56) ||
-      (tcp [2] != 0x34) || (tcp [3] != 0x12))
-  {
-    fprintf (stderr, "%s: compiled with the wrong byte sex!\n"
-	             " Check the LITTLEENDIAN macro in os/unix-curses.c\n",
-	             argv [0]);
-    exit (1);
-  }
 
   if (argc != 2)
   {

>Release-Note:
>Audit-Trail:
>Unformatted: