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

Skip to content

Commit f74f63a

Browse files
committed
Initial port to CodeWarrior CFM68K support (mainly by disabling
unsupported features).
1 parent eceb3e3 commit f74f63a

8 files changed

Lines changed: 24 additions & 5 deletions

File tree

Mac/Include/config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#define HAVE_FOPENRF
1414
#endif
1515

16-
#ifdef __CFM68K__
16+
#ifdef SYMANTEC__CFM68K__
1717
#define atof Py_AtoF
1818
#define strtod Py_StrToD
1919
#endif

Mac/Include/macdefs.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313

1414
#ifdef __MWERKS__
1515
#include "errno_unix.h"
16+
#include <Strings.h>
17+
#define c2pstr C2PStr
18+
#define p2cstr P2CStr
1619
#endif
1720
#include <errno.h>
1821
#include <string.h>

Mac/Include/macglue.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
3434
#define HAVE_UNIVERSAL_HEADERS
3535
#endif
3636

37-
#ifdef __CFM68K__
37+
#ifdef SYMANTEC__CFM68K__
3838
#pragma lib_export on
3939
#endif
4040

Mac/Modules/config.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,14 @@ getversion()
9494
#ifdef __MWERKS__
9595
#ifdef __powerc
9696
strcat(version, " [MW PPC compiler]");
97+
#else
98+
#ifdef __CFM68K__
99+
strcat(version, " [MW CFM68K compiler]");
97100
#else
98101
strcat(version, " [MW 68K compiler]");
99102
#endif
100103
#endif
104+
#endif
101105
#ifdef THINK_C
102106
#ifdef __SC__
103107
strcat(version, " [Symantec Think C compiler]");
@@ -330,7 +334,7 @@ struct {
330334
} inittab[] = {
331335

332336
{"array", initarray},
333-
#ifndef __CFM68K__
337+
#ifndef SYMANTEC__CFM68K__
334338
/* The math library seems mostly broken... */
335339
{"math", initmath},
336340
#endif

Mac/Python/macapplication.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,15 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2424

2525
/* Macintosh Applet Python main program */
2626

27-
#ifdef __CFM68K__
27+
#ifdef SYMANTEC__CFM68K__
2828
#pragma lib_export on
2929
#endif
3030

3131
extern void PyMac_InitApplication();
3232

3333
main() {
34+
#if defined(__MWERKS__) && defined(__CFM68K__)
35+
printf("Hello, world!\n");
36+
#endif
3437
PyMac_InitApplication();
3538
}

Mac/Python/macgetargv.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
5050
#define HAVE_UNIVERSAL_HEADERS
5151
#endif
5252

53-
#ifdef __CFM68K__
53+
#ifdef SYMANTEC__CFM68K__
5454
#pragma lib_export on
5555
#endif
5656

@@ -120,6 +120,9 @@ get_full_path (FSSpec *fss, char *buf)
120120
char tmpbuf[256];
121121
int plen;
122122

123+
#if defined(__MWERKS__) && defined(__CFM68K__)
124+
return -1; /* get_folder_parent doesn't work */
125+
#endif
123126
fss_current = *fss;
124127
plen = fss_current.name[0];
125128
memcpy(buf, &fss_current.name[1], plen);

Mac/Python/macglue.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,9 @@ static void
223223
scan_event_queue(flush)
224224
int flush;
225225
{
226+
#if defined(__MWERKS__) && defined(__CFM68K__)
227+
return; /* No GetEvQHdr yet */
228+
#else
226229
register EvQElPtr q;
227230

228231
q = (EvQElPtr) GetEvQHdr()->qHead;
@@ -237,6 +240,7 @@ scan_event_queue(flush)
237240
break;
238241
}
239242
}
243+
#endif
240244
}
241245

242246
int
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#define HAVE_CONFIG_H
2+
#define USE_MAC_DYNAMIC_LOADING

0 commit comments

Comments
 (0)