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

Skip to content

Commit 921a08f

Browse files
committed
Walker's changes fixed so they work in THINK C 5
1 parent 3ce7a1a commit 921a08f

1 file changed

Lines changed: 17 additions & 10 deletions

File tree

Mac/Modules/macmodule.c

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,27 +36,28 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
3636

3737
#include <fcntl.h>
3838

39-
#include "macdefs.h"
40-
#include "dir.h"
41-
#include "stat.h"
39+
#include "::unixemu:macdefs.h"
40+
#include "::unixemu:dir.h"
41+
#include "::unixemu:stat.h"
4242

4343
#ifndef MAXPATHLEN
4444
#define MAXPATHLEN 1024
4545
#endif
4646

4747
/* Prototypes for Unix simulation on Mac */
4848

49-
int access PROTO((char *path, int mode));
50-
int chdir PROTO((char *path));
49+
int access PROTO((const char *path, int mode));
50+
int chdir PROTO((const char *path));
5151
char *getbootvol PROTO((void));
5252
char *getwd PROTO((char *));
53-
int mkdir PROTO((char *path, int mode));
54-
DIR * opendir PROTO((char *));
53+
int mkdir PROTO((const char *path, int mode));
54+
DIR * opendir PROTO((char *));
5555
void closedir PROTO((DIR *));
5656
struct direct * readdir PROTO((DIR *));
57-
int rmdir PROTO((char *path));
58-
int stat PROTO((char *path, struct stat *buf));
57+
int rmdir PROTO((const char *path));
58+
int stat PROTO((const char *path, struct stat *buf));
5959
int sync PROTO((void));
60+
int unlink PROTO((const char *));
6061

6162

6263

@@ -67,7 +68,7 @@ static object *MacError; /* Exception mac.error */
6768
static object *
6869
mac_error()
6970
{
70-
return err_errno(MacError);
71+
return err_errno(MacError);
7172
}
7273

7374
/* MAC generic methods */
@@ -160,6 +161,8 @@ mac_close(self, args)
160161
return None;
161162
}
162163

164+
#ifdef MPW
165+
163166
static object *
164167
mac_dup(self, args)
165168
object *self;
@@ -195,6 +198,8 @@ mac_fdopen(self, args)
195198
return newopenfileobject(fp, "(fdopen)", mode, fclose);
196199
}
197200

201+
#endif /* MPW */
202+
198203
static object *
199204
mac_getbootvol(self, args)
200205
object *self;
@@ -424,8 +429,10 @@ static struct methodlist mac_methods[] = {
424429
{"access", mac_access},
425430
{"chdir", mac_chdir},
426431
{"close", mac_close},
432+
#ifdef MPW
427433
{"dup", mac_dup},
428434
{"fdopen", mac_fdopen},
435+
#endif
429436
{"getbootvol", mac_getbootvol}, /* non-standard */
430437
{"getcwd", mac_getcwd},
431438
{"listdir", mac_listdir},

0 commit comments

Comments
 (0)