More Mac changes.

This commit is contained in:
rsc 2003-11-24 22:48:39 +00:00
parent 8b6a5e678a
commit 54952cec10
2 changed files with 31 additions and 14 deletions

View file

@ -44,8 +44,6 @@ extern "C" {
#define _HAVETMTZOFF 1
#define _HAVEFUTIMESAT 1
#define _HAVEFUTIMES 1
#define _HAVEGETDENTS 1
#define _HAVEGETDIRENTRIES 1
typedef long p9jmp_buf[sizeof(sigjmp_buf)/sizeof(long)];
@ -60,7 +58,6 @@ typedef long p9jmp_buf[sizeof(sigjmp_buf)/sizeof(long)];
# undef _HAVETMZONE
# undef _HAVETMTZOFF
# undef _HAVEFUTIMESAT
# undef _HAVEGETDENTS
#endif
#if defined(__sun__)
# include <sys/types.h>
@ -86,6 +83,8 @@ typedef long p9jmp_buf[sizeof(sigjmp_buf)/sizeof(long)];
# include <sys/types.h>
# undef _NEEDUSHORT
# undef _NEEDUINT
# define _NEEDLL 1
# define _GETDIRENTRIES_TAKES_LONG 1
#endif
typedef signed char schar;
@ -432,8 +431,8 @@ enum
};
/* extern int abs(int); <stdlib.h> */
extern int atexit(void(*)(void));
extern void atexitdont(void(*)(void));
extern int p9atexit(void(*)(void));
extern void p9atexitdont(void(*)(void));
extern int atnotify(int(*)(void*, char*), int);
/*
* <stdlib.h>
@ -475,7 +474,8 @@ extern int postnote(int, int, char *);
extern double pow10(int);
/* extern int putenv(char*, char*); <stdlib.h. */
/* extern void qsort(void*, long, long, int (*)(void*, void*)); <stdlib.h> */
extern int p9setjmp(p9jmp_buf);
/* extern int p9setjmp(p9jmp_buf); */
#define p9setjmp(b) sigsetjmp((void*)(b), 1)
/*
* <stdlib.h>
extern double strtod(char*, char**);
@ -490,6 +490,8 @@ extern long time(long*);
/* extern int tolower(int); <ctype.h> */
/* extern int toupper(int); <ctype.h> */
#ifndef NOPLAN9DEFINES
#define atexit p9atexit
#define atexitdont p9atexitdont
#define getenv p9getenv
#define getwd p9getwd
#define longjmp p9longjmp

View file

@ -58,14 +58,29 @@ struct Reprog{
Reinst firstinst[5]; /* .text */
};
extern Reprog *regcomp(char*);
extern Reprog *regcomplit(char*);
extern Reprog *regcompnl(char*);
extern void regerror(char*);
extern int regexec(Reprog*, char*, Resub*, int);
extern void regsub(char*, char*, int, Resub*, int);
extern Reprog *regcomp9(char*);
extern Reprog *regcomplit9(char*);
extern Reprog *regcompnl9(char*);
extern void regerror9(char*);
extern int regexec9(Reprog*, char*, Resub*, int);
extern void regsub9(char*, char*, int, Resub*, int);
extern int rregexec(Reprog*, Rune*, Resub*, int);
extern void rregsub(Rune*, Rune*, Resub*, int);
extern int rregexec9(Reprog*, Rune*, Resub*, int);
extern void rregsub9(Rune*, Rune*, Resub*, int);
/*
* Darwin simply cannot handle having routines that
* override other library routines.
*/
#ifndef NOPLAN9DEFINES
#define regcomp regcomp9
#define regcomplit regcomplit9
#define regcompnl regcompnl9
#define regerror regerror9
#define regexec regexec9
#define regsub regsub9
#define rregexec rregexec9
#define rregsub rregsub9
#endif
#endif