Macintosh port update

Several long-awaited updates for the Macintosh port, by Dean
Luick and myself.  This set affects Mac-only files.

* Update the support for MPW compilers.
* Use new system call names provided for in the latest Apple
  Universal Headers.
* Tune up some of the includes for CodeWarrior.
* Define YY_NEVER_INTERACTIVE for the dungeon and level compilers.
* Remove pointless debugging code.
* Clean up some unterminated comments.
This commit is contained in:
kmhugo
2002-01-10 06:53:52 +00:00
parent 631df10a34
commit 87843397c3
11 changed files with 136 additions and 157 deletions
+24 -4
View File
@@ -2,7 +2,8 @@
/* Copyright (c) Michael Hamel, 1991 */
/* NetHack may be freely redistributed. See license for details. */
#ifdef applec /* This needs to be resident always */
#if defined(macintosh) && defined(__SC__) && !defined(__FAR_CODE__)
/* this needs to be resident always */
#pragma segment Main
#endif
@@ -12,6 +13,25 @@
#include <TextUtils.h>
#include <Resources.h>
void error(const char *format,...)
{
Str255 buf;
va_list ap;
va_start(ap, format);
vsprintf((char *)buf, format, ap);
va_end(ap);
C2P((char *)buf, buf);
ParamText(buf, (StringPtr)"", (StringPtr)"", (StringPtr)"");
Alert(128, (ModalFilterUPP) NULL);
ExitToShell();
}
#if 0 /* Remainder of file is obsolete and will be removed */
#define stackDepth 1
#define errAlertID 129
#define stdIOErrID 1999
@@ -33,7 +53,6 @@ void showerror(char * errdesc, const char * errcomment)
itemHit = Alert(errAlertID, (ModalFilterUPP)nil);
}
Boolean itworked(short errcode)
/* Return TRUE if it worked, do an error message and return false if it didn't. Error
strings for native C errors are in STR#1999, Mac errs in STR 2000-errcode, e.g
@@ -111,13 +130,13 @@ error VA_DECL(const char *, line)
showerror("of an internal error",line);
}
void attemptingto(char * activity)
/* Say what we are trying to do for subsequent error-handling: will appear as x in an
alert in the form "Could not x because y" */
{ C2P(activity,gActivities[gTopactivity]);
}
#if 0 /* Apparently unused */
void comment(char *s, long n)
{
Str255 paserr;
@@ -145,4 +164,5 @@ void popattempt(void)
if (gTopactivity > 1) --gTopactivity;
else error("activity stack underflow");
}
#endif /* Apparently unused */
#endif /* Obsolete */