File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
6173static int interrupted ;
6274
6375static 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
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ int debugging;
4242
4343/* Forward */
4444grammar * getgrammar PROTO ((char * filename )) ;
45- #ifdef THINK_C
45+ #ifdef macintosh
4646int main PROTO ((int , char * * ));
4747char * 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
119119char *
120120askfile ()
121121{
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments