mirror of https://github.com/python/cpython.git
Modified for GUSI
This commit is contained in:
parent
b852b74c71
commit
c743c8d166
|
@ -13,8 +13,21 @@
|
||||||
#define HAVE_FOPENRF
|
#define HAVE_FOPENRF
|
||||||
#endif
|
#endif
|
||||||
#ifdef __MWERKS__
|
#ifdef __MWERKS__
|
||||||
|
#ifndef USE_GUSI
|
||||||
#define HAVE_FOPENRF
|
#define HAVE_FOPENRF
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef USE_GUSI
|
||||||
|
/* GUSI provides a lot of unixisms */
|
||||||
|
#define HAVE_SELECT
|
||||||
|
#define DIRENT
|
||||||
|
#define HAVE_GETPEERNAME
|
||||||
|
#define HAVE_SELECT
|
||||||
|
#define HAVE_FCNTL_H
|
||||||
|
#define HAVE_SYS_TIME_H
|
||||||
|
#define HAVE_UNISTD_H
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef SYMANTEC__CFM68K__
|
#ifdef SYMANTEC__CFM68K__
|
||||||
#define atof Py_AtoF
|
#define atof Py_AtoF
|
||||||
|
|
|
@ -122,6 +122,10 @@ extern void initimgop();
|
||||||
#ifdef USE_TK
|
#ifdef USE_TK
|
||||||
extern void init_tkinter();
|
extern void init_tkinter();
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef USE_GUSI
|
||||||
|
extern void initsocket();
|
||||||
|
extern void initselect();
|
||||||
|
#endif
|
||||||
/* -- ADDMODULE MARKER 1 -- */
|
/* -- ADDMODULE MARKER 1 -- */
|
||||||
|
|
||||||
extern void PyMarshal_Init();
|
extern void PyMarshal_Init();
|
||||||
|
@ -204,6 +208,10 @@ struct {
|
||||||
#ifdef USE_TK
|
#ifdef USE_TK
|
||||||
{"_tkinter", init_tkinter},
|
{"_tkinter", init_tkinter},
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef USE_GUSI
|
||||||
|
{"socket", initsocket},
|
||||||
|
{"select", initselect},
|
||||||
|
#endif
|
||||||
|
|
||||||
/* -- ADDMODULE MARKER 2 -- */
|
/* -- ADDMODULE MARKER 2 -- */
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,13 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#undef S_ISREG
|
#undef S_ISREG
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef USE_GUSI
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <stat.h>
|
||||||
|
#define macstat stat
|
||||||
|
#else
|
||||||
#include "macstat.h"
|
#include "macstat.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __MWERKS__
|
#ifdef __MWERKS__
|
||||||
/* For CodeWarrior 4 also define CW4 */
|
/* For CodeWarrior 4 also define CW4 */
|
||||||
|
@ -57,7 +63,11 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "macdefs.h"
|
#include "macdefs.h"
|
||||||
|
#ifdef USE_GUSI
|
||||||
|
#include <dirent.h>
|
||||||
|
#else
|
||||||
#include "dirent.h"
|
#include "dirent.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef MAXPATHLEN
|
#ifndef MAXPATHLEN
|
||||||
#define MAXPATHLEN 1024
|
#define MAXPATHLEN 1024
|
||||||
|
@ -68,13 +78,19 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
int chdir PROTO((const char *path));
|
int chdir PROTO((const char *path));
|
||||||
char *getbootvol PROTO((void));
|
char *getbootvol PROTO((void));
|
||||||
char *getwd PROTO((char *));
|
char *getwd PROTO((char *));
|
||||||
|
#ifdef USE_GUSI
|
||||||
|
int mkdir PROTO((const char *path));
|
||||||
|
DIR * opendir PROTO((const char *));
|
||||||
|
int closedir PROTO((DIR *));
|
||||||
|
#else
|
||||||
int mkdir PROTO((const char *path, int mode));
|
int mkdir PROTO((const char *path, int mode));
|
||||||
DIR * opendir PROTO((char *));
|
DIR * opendir PROTO((char *));
|
||||||
void closedir PROTO((DIR *));
|
void closedir PROTO((DIR *));
|
||||||
|
#endif
|
||||||
struct dirent * readdir PROTO((DIR *));
|
struct dirent * readdir PROTO((DIR *));
|
||||||
int rmdir PROTO((const char *path));
|
int rmdir PROTO((const char *path));
|
||||||
int sync PROTO((void));
|
int sync PROTO((void));
|
||||||
#if defined(THINK_C) || defined(__SC__)
|
#if defined(THINK_C) || defined(__SC__) || defined(USE_GUSI)
|
||||||
int unlink PROTO((char *));
|
int unlink PROTO((char *));
|
||||||
#else
|
#else
|
||||||
int unlink PROTO((const char *));
|
int unlink PROTO((const char *));
|
||||||
|
@ -315,12 +331,26 @@ mac_lseek(self, args)
|
||||||
}
|
}
|
||||||
#endif /* !CW4 */
|
#endif /* !CW4 */
|
||||||
|
|
||||||
|
#ifdef USE_GUSI
|
||||||
|
/* GUSI mkdir doesn't accept the (dummy) mode. Grrr. */
|
||||||
|
int _gusi_mkdir(name, mode)
|
||||||
|
char *name;
|
||||||
|
int mode;
|
||||||
|
{
|
||||||
|
return mkdir(name);
|
||||||
|
}
|
||||||
|
#endif /* USE_GUSI */
|
||||||
|
|
||||||
static object *
|
static object *
|
||||||
mac_mkdir(self, args)
|
mac_mkdir(self, args)
|
||||||
object *self;
|
object *self;
|
||||||
object *args;
|
object *args;
|
||||||
{
|
{
|
||||||
|
#ifdef USE_GUSI
|
||||||
|
return mac_strint(args, _gusi_mkdir);
|
||||||
|
#else
|
||||||
return mac_strint(args, mkdir);
|
return mac_strint(args, mkdir);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef CW4
|
#ifndef CW4
|
||||||
|
@ -425,6 +455,19 @@ mac_xstat(self, args)
|
||||||
END_SAVE
|
END_SAVE
|
||||||
if (res != 0)
|
if (res != 0)
|
||||||
return mac_error();
|
return mac_error();
|
||||||
|
#ifdef USE_GUSI
|
||||||
|
return mkvalue("(llllllllll)",
|
||||||
|
(long)st.st_mode,
|
||||||
|
(long)st.st_ino,
|
||||||
|
(long)st.st_dev,
|
||||||
|
(long)st.st_nlink,
|
||||||
|
(long)st.st_uid,
|
||||||
|
(long)st.st_gid,
|
||||||
|
(long)st.st_size,
|
||||||
|
(long)st.st_atime,
|
||||||
|
(long)st.st_mtime,
|
||||||
|
(long)st.st_ctime);
|
||||||
|
#else
|
||||||
return mkvalue("(llllllllllls#s#)",
|
return mkvalue("(llllllllllls#s#)",
|
||||||
(long)st.st_mode,
|
(long)st.st_mode,
|
||||||
(long)st.st_ino,
|
(long)st.st_ino,
|
||||||
|
@ -439,6 +482,7 @@ mac_xstat(self, args)
|
||||||
(long)st.st_rsize,
|
(long)st.st_rsize,
|
||||||
st.st_creator, 4,
|
st.st_creator, 4,
|
||||||
st.st_type, 4);
|
st.st_type, 4);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static object *
|
static object *
|
||||||
|
|
|
@ -31,8 +31,8 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
extern void PyMac_InitApplication();
|
extern void PyMac_InitApplication();
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
#if defined(__MWERKS__) && defined(USE_TK)
|
#if defined(USE_GUSI)
|
||||||
PyTk_InitGUSI();
|
GUSIDefaultSetup();
|
||||||
#endif
|
#endif
|
||||||
#if defined(__MWERKS__) && defined(__CFM68K__)
|
#if defined(__MWERKS__) && defined(__CFM68K__)
|
||||||
printf("Hello, world!\n");
|
printf("Hello, world!\n");
|
||||||
|
|
|
@ -5,13 +5,18 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __MWERKS__
|
#ifdef __MWERKS__
|
||||||
|
#ifdef USE_GUSI
|
||||||
|
#define HASGUSI " w/GUSI"
|
||||||
|
#else
|
||||||
|
#define HASGUSI ""
|
||||||
|
#endif
|
||||||
#ifdef __powerc
|
#ifdef __powerc
|
||||||
#define COMPILER " [CW PPC]"
|
#define COMPILER " [CW PPC" HASGUSI "]"
|
||||||
#else
|
#else
|
||||||
#ifdef __CFM68K__
|
#ifdef __CFM68K__
|
||||||
#define COMPILER " [CW CFM68K]"
|
#define COMPILER " [CW CFM68K" HASGUSI "]"
|
||||||
#else
|
#else
|
||||||
#define COMPILER " [CW 68K]"
|
#define COMPILER " [CW 68K" HASGUSI "]"
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue