Skip to content

Commit

Permalink
build: fixes for mingw-w64
Browse files Browse the repository at this point in the history
R=rsc
CC=golang-dev
https://golang.org/cl/4742042
  • Loading branch information
wgj-zz authored and rsc committed Jul 25, 2011
1 parent 0871af2 commit ee14fbd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions include/libc.h
Original file line number Diff line number Diff line change
Expand Up @@ -292,16 +292,20 @@ extern char* getgoroot(void);
extern char* getgoversion(void);

#ifdef _WIN32

#ifndef _WIN64
struct timespec {
int tv_sec;
long tv_nsec;
};
#define execv(prog, argv) execv(prog, (const char* const*)(argv))
#define execvp(prog, argv) execvp(prog, (const char**)(argv))
#endif

extern int nanosleep(const struct timespec *rqtp, struct timespec *rmtp);
extern int fork(void);
extern int pread(int fd, void *buf, int n, int off);
extern int pwrite(int fd, void *buf, int n, int off);
#define execv(prog, argv) execv(prog, (const char* const*)(argv))
#define execvp(prog, argv) execvp(prog, (const char**)(argv))
#define lseek(fd, n, base) _lseeki64(fd, n, base)
#define mkdir(path, perm) mkdir(path)
#define pipe(fd) _pipe(fd, 512, O_BINARY)
Expand Down
2 changes: 1 addition & 1 deletion src/lib9/fmt/dofmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ __ifmt(Fmt *f)
}
#endif
if(f->r == 'p'){
u = (ulong)va_arg(f->args, void*);
u = (uintptr)va_arg(f->args, void*);
f->r = 'x';
fl |= FmtUnsigned;
}else if(fl & FmtVLong){
Expand Down
2 changes: 1 addition & 1 deletion src/libmach/5.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include "ureg_arm.h"
#include <mach.h>

#define REGOFF(x) (ulong) (&((struct Ureg *) 0)->x)
#define REGOFF(x) (uintptr) (&((struct Ureg *) 0)->x)

#define SP REGOFF(r13)
#define PC REGOFF(pc)
Expand Down

0 comments on commit ee14fbd

Please sign in to comment.