Macintosh util update
* Updated preprocessor conditionals for the MPW compilers. * Remove obsolete Mac code in util/*_comp.l.
This commit is contained in:
@@ -74,33 +74,6 @@ void FDECL(init_yyout, (FILE *));
|
||||
extern YYSTYPE yylval;
|
||||
|
||||
int line_number = 1;
|
||||
/*
|
||||
* This is a hack required by Michael Hamel to get things
|
||||
* working on the Mac.
|
||||
*/
|
||||
#if defined(applec) && !defined(FLEX_SCANNER) && !defined(FLEXHACK_SCANNER)
|
||||
#undef input
|
||||
#undef unput
|
||||
#define unput(c) { yytchar = (c); if (yytchar == 10) yylineno--; *yysptr++ = yytchar; }
|
||||
# ifndef YYNEWLINE
|
||||
# define YYNEWLINE 10
|
||||
# endif
|
||||
|
||||
char
|
||||
input() /* Under MPW \n is chr(13)! Compensate for this. */
|
||||
{
|
||||
if (yysptr > yysbuf) return(*--yysptr);
|
||||
else {
|
||||
yytchar = getc(yyin);
|
||||
if (yytchar == '\n') {
|
||||
yylineno++;
|
||||
return(YYNEWLINE);
|
||||
}
|
||||
if (yytchar == EOF) return(0);
|
||||
else return(yytchar);
|
||||
}
|
||||
}
|
||||
#endif /* applec && !FLEX_SCANNER && !FLEXHACK_SCANNER */
|
||||
|
||||
%}
|
||||
%%
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "dlb.h"
|
||||
|
||||
#ifdef MAC
|
||||
# ifdef applec
|
||||
# if defined(__SC__) || defined(__MRC__)
|
||||
# define MPWTOOL
|
||||
#include <CursorCtl.h>
|
||||
# else
|
||||
|
||||
@@ -74,34 +74,6 @@ int line_number = 1, colon_line_number = 1;
|
||||
static char map[4096];
|
||||
static int map_cnt = 0;
|
||||
|
||||
/*
|
||||
* This is a hack required by Michael Hamel to get things
|
||||
* working on the Mac.
|
||||
*/
|
||||
#if defined(applec) && !defined(FLEX_SCANNER) && !defined(FLEXHACK_SCANNER)
|
||||
#undef input
|
||||
#undef unput
|
||||
#define unput(c) { yytchar = (c); if (yytchar == 10) yylineno--; *yysptr++ = yytchar; }
|
||||
# ifndef YYNEWLINE
|
||||
# define YYNEWLINE 10
|
||||
# endif
|
||||
|
||||
char
|
||||
input() /* Under MPW \n is chr(13)! Compensate for this. */
|
||||
{
|
||||
if (yysptr > yysbuf) return(*--yysptr);
|
||||
else {
|
||||
yytchar = getc(yyin);
|
||||
if (yytchar == '\n') {
|
||||
yylineno++;
|
||||
return(YYNEWLINE);
|
||||
}
|
||||
if (yytchar == EOF) return(0);
|
||||
else return(yytchar);
|
||||
}
|
||||
}
|
||||
#endif /* applec && !FLEX_SCANNER && !FLEXHACK_SCANNER */
|
||||
|
||||
%}
|
||||
%e 1500
|
||||
%p 5000
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
* This file contains the main function for the parser
|
||||
* and some useful functions needed by yacc
|
||||
*/
|
||||
#define SPEC_LEV /* for MPW */
|
||||
/* although, why don't we move those special defined here.. and in dgn_main? */
|
||||
|
||||
#include "hack.h"
|
||||
#include "date.h"
|
||||
@@ -15,7 +17,7 @@
|
||||
#endif
|
||||
|
||||
#ifdef MAC
|
||||
# ifdef applec
|
||||
# if defined(__SC__) || defined(__MRC__)
|
||||
# define MPWTOOL
|
||||
#include <CursorCtl.h>
|
||||
# else
|
||||
@@ -47,7 +49,7 @@
|
||||
# define OMASK 0644
|
||||
#endif
|
||||
|
||||
#define NEWLINE 10 /* under Mac MPW C '\n' is 13 so don't use it. */
|
||||
#define NEWLINE '\n' /* changes to 13 for MPW */
|
||||
|
||||
#define ERR (-1)
|
||||
|
||||
@@ -1108,7 +1110,11 @@ specialmaze *maze_level;
|
||||
Strcat(lbuf, filename);
|
||||
Strcat(lbuf, LEV_EXT);
|
||||
|
||||
#if defined(MAC) && (defined(__SC__) || defined(__MRC__))
|
||||
fout = open(lbuf, O_WRONLY|O_CREAT|O_BINARY);
|
||||
#else
|
||||
fout = open(lbuf, O_WRONLY|O_CREAT|O_BINARY, OMASK);
|
||||
#endif
|
||||
if (fout < 0) return FALSE;
|
||||
|
||||
if (room_level) {
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#endif
|
||||
|
||||
#ifdef MAC
|
||||
# ifdef applec /* Means the MPW compiler, I hope */
|
||||
# if defined(__SC__) || defined(__MRC__) /* MPW compilers */
|
||||
# define MPWTOOL
|
||||
#include <CursorCtl.h>
|
||||
#include <string.h>
|
||||
@@ -87,7 +87,11 @@ static const char SCCS_Id[] = "@(#)makedefs.c\t3.3\t1999/08/16";
|
||||
# define INCLUDE_TEMPLATE "..\\include\\%s"
|
||||
# define SOURCE_TEMPLATE "..\\src\\%s"
|
||||
# define DGN_TEMPLATE "..\\dat\\%s" /* where dungeon.pdf file goes */
|
||||
# define DATA_TEMPLATE "..\\dat\\%s"
|
||||
# if __SC__ || __MRC__
|
||||
# define DATA_TEMPLATE ":Dungeon:%s"
|
||||
# else
|
||||
# define DATA_TEMPLATE ":lib:%s"
|
||||
# endif /* __SC__ || __MRC__ */
|
||||
# define DATA_IN_TEMPLATE "..\\dat\\%s"
|
||||
# else /* OS2 */
|
||||
# define INCLUDE_TEMPLATE "../include/%s"
|
||||
|
||||
Reference in New Issue
Block a user