Amiga: drop legacy non-gcc compiler guards

Remove AZTEC_C, _DCC, SASC, LATTICE, MANX arms. The port targets bebbo gcc.
This commit is contained in:
Ingo Paschke
2026-05-11 20:29:47 +02:00
parent 22ddba7c1e
commit f0b6ddc6f8
10 changed files with 3 additions and 171 deletions
-9
View File
@@ -20,10 +20,8 @@
#undef COUNT
#if defined(__SASC_60) || defined(__GNUC__)
#include <proto/exec.h>
#include <proto/dos.h>
#endif
/* POSIX stubs needed by libnix (-noixemul) */
#ifdef __noixemul__
@@ -85,11 +83,6 @@ free_nhuuid(void)
}
}
#ifdef AZTEC_50
#include <functions.h>
#undef strcmpi
#endif
/* Prototypes */
#ifndef CROSS_TO_AMIGA
#include "NH:sys/amiga/amiwind.p"
@@ -107,9 +100,7 @@ extern struct window_procs amii_procs;
struct ami_sysflags sysflags = {0};
FILE *fopenp(const char *, const char *);
#ifndef __SASC_60
int Enable_Abort = 0; /* for stdio package */
#endif
/* Initial path, so we can find NetHack.cnf */
char PATH[PATHLEN] = "NetHack:";
-15
View File
@@ -17,25 +17,10 @@
#include <string.h>
#include <errno.h>
#ifdef __SASC
#include <dos.h> /* for __emit */
#include <string.h>
#include <proto/dos.h>
#include <proto/exec.h>
#include <proto/graphics.h>
#include <proto/intuition.h>
#include <proto/diskfont.h>
#include <proto/console.h>
#endif
#include "hack.h"
#include "winprocs.h"
#include "winami.h"
#ifdef AZTEC
#include <functions.h>
#endif
#ifndef CROSS_TO_AMIGA
#include "NH:sys/amiga/winami.p"
#include "NH:sys/amiga/amiwind.p"
-16
View File
@@ -28,20 +28,10 @@ static struct RastPort *rp;
#undef NULL
#define NULL 0
#ifdef AZTEC_C
#include <functions.h>
#else
#ifdef _DCC
#include <clib/dos_protos.h>
#include <clib/exec_protos.h>
#include <clib/console_protos.h>
#include <clib/diskfont_protos.h>
#else
#include <proto/dos.h>
#include <proto/exec.h>
#include <proto/console.h>
#include <proto/diskfont.h>
#endif
static BitMapHeader tomb_bmhd;
static struct BitMap *tombimg = NULL;
@@ -58,14 +48,8 @@ static int xoff, yoff; /* image centering */
#undef red
#undef green
#undef blue
#ifdef _DCC
#include <clib/graphics_protos.h>
#include <clib/intuition_protos.h>
#else
#include <proto/graphics.h>
#include <proto/intuition.h>
#endif
#endif /* AZTEC_C */
static struct Window *ripwin = 0;
static void tomb_text(char *);
+2 -17
View File
@@ -2,30 +2,15 @@
/* Copyright (c) Janne Salmijärvi, Tampere, Finland, 2000 */
/* NetHack may be freely redistributed. See license for details. */
/*
* Increase stack size to allow deep recursions.
*
* Note: This is SAS/C specific, using other compiler probably
* requires another method for increasing stack.
*
*/
#ifdef __SASC_60
#include <dos.h>
#endif
/*
* Increase stack size to allow deep recursions.
* NetHack 5.0 with Lua needs significantly more stack than 3.6.
*
* libnix needs __stkinit referenced to pull swapstack.o from libnix.a.
*/
#ifdef __SASC_60
long __stack = 256 * 1024;
#else
/* libnix needs __stkinit referenced to pull swapstack.o from libnix.a */
unsigned long __stack = 256 * 1024;
#ifdef CROSS_TO_AMIGA
extern void __stkinit(void);
void *__nh_force_stkinit = __stkinit;
#endif
#endif
-7
View File
@@ -13,13 +13,6 @@
#include <stdio.h>
#include <proto/dos.h>
#ifdef _DCC
#define getch() getchar()
#endif
#ifdef __SASC_60
#include <clib/dos_protos.h>
#endif
void tty_change_color(void);
char *tty_get_color_string(void);
-28
View File
@@ -711,7 +711,6 @@ amii_cleanup(void)
void
Abort(long rc)
{
int fault = 1;
#ifdef CHDIR
extern char orgdir[];
chdir(orgdir);
@@ -724,38 +723,11 @@ Abort(long rc)
} else
#endif
printf("\n\nAbort with alert code %08lx...\n", rc);
/* Alert(rc); this is too severe */
#ifdef __SASC
#ifdef INTUI_NEW_LOOK
if (IntuitionBase->LibNode.lib_Version >= 37) {
struct EasyStruct es = {
sizeof(struct EasyStruct), 0, "NetHack Panic Request",
"NetHack is Aborting with code == 0x%08lx",
"Continue Abort|Return to Program|Clean up and exit",
};
fault = EasyRequest(NULL, &es, NULL, (long) rc);
if (fault == 2)
return;
}
#endif
if (fault == 1) {
/* __emit(0x4afc); */ /* illegal instruction */
__emit(0x40fc); /* divide by */
__emit(0x0000); /* #0 */
/* NOTE: don't move amii_cleanup() above here - */
/* it is too likely to kill the system */
/* before it can get the SnapShot out, if */
/* there is something really wrong. */
}
#endif
#ifdef AMII_GRAPHICS
if (windowprocs.win_init_nhwindows == amii_procs.win_init_nhwindows)
amii_cleanup();
#endif
#undef exit
#ifdef AZTEC_C
_abort();
#endif
exit((int) rc);
}
+1 -11
View File
@@ -1161,17 +1161,7 @@ amii_display_file(const char *fn, boolean complain)
if ((fp = dlb_fopen(fn, RDTMODE)) == (dlb *) NULL) {
if (complain) {
sprintf(buf, "Can't display %s: %s", fn,
#if defined(_DCC) || defined(__GNUC__)
strerror(errno)
#else
#ifdef __SASC_60
__sys_errlist[errno]
#else
sys_errlist[errno]
#endif
#endif
);
sprintf(buf, "Can't display %s: %s", fn, strerror(errno));
amii_addtopl(buf);
}
return;
-2
View File
@@ -7,9 +7,7 @@
#include <exec/types.h>
#include <libraries/iffparse.h>
#include <graphics/scale.h>
#ifndef _DCC
#include <proto/iffparse.h>
#endif
#ifdef TESTING
#include "hack.h"
-44
View File
@@ -5,9 +5,6 @@
#include <exec/types.h>
#include <exec/memory.h>
#include <exec/io.h>
#if !defined(_DCC) && !defined(__GNUC__)
#include <dos.h>
#endif
#include <exec/alerts.h>
#include <exec/devices.h>
#include <exec/execbase.h>
@@ -19,25 +16,10 @@
#include <libraries/gadtools.h>
#include <libraries/dosextens.h>
#include <libraries/asl.h>
/* stddef.h is included in the precompiled version of hack.h . If we include
* it here normally (through string.h) we'll get an "illegal typedef" later
* on. This is the easiest way I can think of to fix it without messing
* around with the rest of the #includes. --AMC
*/
#if defined(_DCC) && !defined(HACK_H)
#define ptrdiff_t ptrdiff_t_
#define size_t size_t_
#define wchar_t wchar_t_
#endif
#include <ctype.h>
#undef strcmpi
#include <string.h>
#include <errno.h>
#if defined(_DCC) && !defined(HACK_H)
#undef ptrdiff_t
#undef size_t
#undef wchar_T
#endif
#ifdef IDCMP_CLOSEWINDOW
#ifndef INTUI_NEW_LOOK
@@ -62,17 +44,6 @@ CLIPPING must be defined for the AMIGA version
/*#define TOPL_GETLINE /* Don't use a window for getlin() */
/*#define WINDOW_YN /* Use a window for y/n questions */
#ifdef AZTEC_C
#include <functions.h>
#else
#ifdef _DCC
#include <clib/dos_protos.h>
#include <clib/exec_protos.h>
#include <clib/console_protos.h>
#include <clib/layers_protos.h>
#include <clib/diskfont_protos.h>
#include <clib/gadtools_protos.h>
#else
#include <proto/dos.h>
#include <proto/exec.h>
#include <proto/console.h>
@@ -80,28 +51,13 @@ CLIPPING must be defined for the AMIGA version
#include <proto/diskfont.h>
#include <proto/gadtools.h>
#include <proto/asl.h>
#endif
/* kludge - see amirip for why */
#undef red
#undef green
#undef blue
#ifdef _DCC
#include <clib/graphics_protos.h>
#else
#include <proto/graphics.h>
#endif
#ifdef _DCC
#define __asm /* DICE doesn't like __asm */
#endif
#ifdef _DCC
#include <clib/intuition_protos.h>
#else
#include <proto/intuition.h>
#endif
#endif
#ifdef SHAREDLIB
#include "NH:sys/amiga/lib/libmacs.h"
-22
View File
@@ -252,7 +252,6 @@ struct FillParams {
WORD offsety;
};
#ifdef __GNUC__
#ifdef __PPC__
void PPC_LayerFillHook(void);
struct EmulLibEntry LayerFillHook = { TRAP_LIB, 0,
@@ -281,16 +280,6 @@ void
LayerFillHook_impl(struct Hook *hk, struct RastPort *rp,
struct FillParams *fp)
{
#endif
#else
void
#ifndef _DCC
__interrupt
#endif
__saveds __asm LayerFillHook(__a0 struct Hook *hk,
__a2 struct RastPort *rp,
__a1 struct FillParams *fp)
{
#endif
long x, y, xmax, ymax;
@@ -828,7 +817,6 @@ amii_create_nhwindow(int type)
return (newid);
}
#ifdef __GNUC__
#ifdef __PPC__
int PPC_SM_Filter(void);
struct EmulLibEntry SM_Filter = { TRAP_LIB, 0,
@@ -857,16 +845,6 @@ int
SM_Filter_impl(struct Hook *hk, ULONG modeID,
struct ScreenModeRequester *smr)
{
#endif
#else
int
#ifndef _DCC
__interrupt
#endif
__saveds __asm SM_Filter(
__a0 struct Hook *hk, __a1 ULONG modeID,
__a2 struct ScreenModeRequester *smr)
{
#endif
struct DimensionInfo dims;
struct DisplayInfo disp;