Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d6a15ad

Browse files
committed
Generalize to macintosh.
1 parent 1e2293d commit d6a15ad

6 files changed

Lines changed: 34 additions & 24 deletions

File tree

Include/pgenheaders.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,15 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2525
/* Include files and extern declarations used by most of the parser.
2626
This is a precompiled header for THINK C. */
2727

28+
#ifdef THINK_C
29+
#define macintosh
30+
/* #define THINK_C_3_0 /*** TURN THIS ON FOR THINK C 3.0 ***/
31+
#endif
32+
2833
#include <stdio.h>
2934
#include <string.h>
3035

3136
#ifdef THINK_C
32-
/* #define THINK_C_3_0 /*** TURN THIS ON FOR THINK C 3.0 ****/
3337
#define label label_
3438
#undef label
3539
#endif
@@ -38,7 +42,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
3842
#include <proto.h>
3943
#endif
4044

41-
#ifdef THINK_C
45+
#ifdef macintosh
4246
#ifndef THINK_C_3_0
4347
#include <stdlib.h>
4448
#endif

Parser/intrcheck.c

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2424

2525
/* Check for interrupts */
2626

27+
#ifdef THINK_C
28+
#define macintosh
29+
#endif
30+
31+
2732
#ifdef MSDOS
2833

2934
/* This might work for MS-DOS (untested though): */
@@ -49,19 +54,26 @@ intrcheck()
4954
#endif
5055

5156

52-
#ifdef THINK_C
57+
#ifdef macintosh
5358

59+
#ifdef THINK_C
5460
/* This is for THINK C 4.0.
5561
For 3.0, you may have to remove the signal stuff. */
56-
5762
#include <MacHeaders>
63+
#else
64+
/* This is for MPW 3.1 */
65+
/* XXX Untested */
66+
#include <OSEvents.h>
67+
#include <SysEqu.h>
68+
#endif
69+
5870
#include <signal.h>
5971
#include "sigtype.h"
6072

6173
static int interrupted;
6274

6375
static SIGTYPE
64-
intcatcher(sig)
76+
intcatcher(ig)
6577
int sig;
6678
{
6779
interrupted = 1;
@@ -80,17 +92,15 @@ intrcheck()
8092
{
8193
register EvQElPtr q;
8294

83-
/* This is like THINK C 4.0's <console.h>.
84-
I'm not sure why FlushEvents must be called from asm{}. */
85-
for (q = (EvQElPtr)EventQueue.qHead; q; q = (EvQElPtr)q->qLink) {
95+
/* This is like THINK C 4.0's <console.h> */
96+
/* q = (EvQElPtr) EventQueue.qHead; */
97+
q = (EvQElPtr) GetEvQHdr()->qHead;
98+
99+
for (; q; q = (EvQElPtr)q->qLink) {
86100
if (q->evtQWhat == keyDown &&
87101
(char)q->evtQMessage == '.' &&
88102
(q->evtQModifiers & cmdKey) != 0) {
89-
90-
asm {
91-
moveq #keyDownMask,d0
92-
_FlushEvents
93-
}
103+
FlushEvents(keyDownMask, 0);
94104
interrupted = 1;
95105
break;
96106
}
@@ -104,7 +114,7 @@ intrcheck()
104114

105115
#define OK
106116

107-
#endif /* THINK_C */
117+
#endif /* macintosh */
108118

109119

110120
#ifndef OK

Parser/pgenmain.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ int debugging;
4242

4343
/* Forward */
4444
grammar *getgrammar PROTO((char *filename));
45-
#ifdef THINK_C
45+
#ifdef macintosh
4646
int main PROTO((int, char **));
4747
char *askfile PROTO((void));
4848
#endif
@@ -57,7 +57,7 @@ main(argc, argv)
5757
FILE *fp;
5858
char *filename;
5959

60-
#ifdef THINK_C
60+
#ifdef macintosh
6161
filename = askfile();
6262
#else
6363
if (argc != 2) {
@@ -115,7 +115,7 @@ getgrammar(filename)
115115
return g;
116116
}
117117

118-
#ifdef THINK_C
118+
#ifdef macintosh
119119
char *
120120
askfile()
121121
{

Parser/tokenizer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
3737
#include "tokenizer.h"
3838
#include "errcode.h"
3939

40-
#ifdef THINK_C
40+
#ifdef macintosh
4141
#define TABSIZE 4
4242
#endif
4343

Python/import.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,9 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
3737
#include "compile.h"
3838
#include "ceval.h"
3939

40-
#ifdef THINK_C
41-
#define macintosh
42-
#endif
43-
4440
/* Define pathname separator used in file names */
4541

46-
#ifdef THINK_C
42+
#ifdef macintosh
4743
#define SEP ':'
4844
#endif
4945

Python/sysmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Data members:
4545

4646
/* Define delimiter used in $PYTHONPATH */
4747

48-
#ifdef THINK_C
48+
#ifdef macintosh
4949
#define DELIM ' '
5050
#endif
5151

0 commit comments

Comments
 (0)