sunos fixes

This commit is contained in:
rsc 2005-01-07 07:47:37 +00:00
parent 190857f93e
commit c345061e8d
13 changed files with 14 additions and 14 deletions

View file

@ -6,6 +6,7 @@ extern "C" {
#define __BSD_VISIBLE 1 /* FreeBSD 5.x */ #define __BSD_VISIBLE 1 /* FreeBSD 5.x */
#define __EXTENSIONS__ 1 /* SunOS */ #define __EXTENSIONS__ 1 /* SunOS */
#define __MAKECONTEXT_V2_SOURCE 1 /* SunOS */
#define _BSD_SOURCE 1 #define _BSD_SOURCE 1
#define _SVID_SOURCE 1 #define _SVID_SOURCE 1
#define _XOPEN_SOURCE 1000 #define _XOPEN_SOURCE 1000

View file

@ -106,7 +106,7 @@ main(int argc, char *argv[])
exits("usage"); exits("usage");
} }
if(initdraw(nil, nil, "colors") < 0) if(initdraw(0, 0, "colors") < 0)
sysfatal("initdraw failed: %r"); sysfatal("initdraw failed: %r");
einit(Emouse); einit(Emouse);

View file

@ -78,7 +78,6 @@ dofmt(Fmt *f, char *fmt)
if(fmt == nil) if(fmt == nil)
return -1; return -1;
} }
return 0; /* not reached */
} }
void * void *

View file

@ -377,7 +377,6 @@ fpcmp(char *a, ulong* f)
a++; a++;
cont:; cont:;
} }
return 0;
} }
static void static void

View file

@ -100,7 +100,6 @@ canrlock(RWLock *l)
l->readers++; l->readers++;
return 1; return 1;
} }
return 1;
} }
void void

View file

@ -34,5 +34,4 @@ utflen(char *s)
s += chartorune(&rune, s); s += chartorune(&rune, s);
n++; n++;
} }
return 0;
} }

View file

@ -42,5 +42,4 @@ utfrrune(char *s, long c)
s1 = s; s1 = s;
s += c1; s += c1;
} }
return 0;
} }

View file

@ -41,5 +41,4 @@ utfrune(char *s, long c)
return s; return s;
s += n; s += n;
} }
return 0;
} }

View file

@ -68,5 +68,4 @@ s_getline(Biobuf *fp, String *to)
} }
c = Bgetc(fp); c = Bgetc(fp);
} }
return 0;
} }

View file

@ -108,5 +108,4 @@ Brdstr(Biobuf *bp, int delim, int nulldelim)
bp->icount = 0; bp->icount = 0;
bp->gbuf = bp->ebuf; bp->gbuf = bp->ebuf;
} }
return 0; /* never happens */
} }

View file

@ -115,7 +115,7 @@ xdraw(Memdrawparam *par)
}else{ }else{
/* this doesn't work on rob's mac? */ /* this doesn't work on rob's mac? */
return 0; return 0;
gc = _x.gcsimplesrc; /* gc = _x.gcsimplesrc;
if(dst->chan == CMAP8 && _x.usetable) if(dst->chan == CMAP8 && _x.usetable)
sdval = _x.tox11[sdval]; sdval = _x.tox11[sdval];
@ -127,6 +127,7 @@ xdraw(Memdrawparam *par)
XSetStipple(_x.display, gc, xmask->pixmap); XSetStipple(_x.display, gc, xmask->pixmap);
_x.gcsimplesrcpixmap = xmask->pixmap; _x.gcsimplesrcpixmap = xmask->pixmap;
} }
*/
} }
XSetTSOrigin(_x.display, gc, mp.x, mp.y); XSetTSOrigin(_x.display, gc, mp.x, mp.y);
XFillRectangle(_x.display, xdst->pixmap, gc, dp.x, dp.y, XFillRectangle(_x.display, xdst->pixmap, gc, dp.x, dp.y,

View file

@ -74,7 +74,7 @@ _procwakeupandunlock(_Procrendez *r)
r->asleep = 0; r->asleep = 0;
pthread_cond_signal(&r->cond); pthread_cond_signal(&r->cond);
} }
unlock(&r->l); unlock(r->l);
} }
static void static void
@ -85,7 +85,7 @@ startprocfn(void *v)
Proc *p; Proc *p;
a = (void**)v; a = (void**)v;
fn = a[0]; fn = (void(*)(void*))a[0];
p = a[1]; p = a[1];
free(a); free(a);
p->osprocid = pthread_self(); p->osprocid = pthread_self();
@ -104,7 +104,7 @@ _procstart(Proc *p, void (*fn)(Proc*))
a = malloc(2*sizeof a[0]); a = malloc(2*sizeof a[0]);
if(a == nil) if(a == nil)
sysfatal("_procstart malloc: %r"); sysfatal("_procstart malloc: %r");
a[0] = fn; a[0] = (void*)fn;
a[1] = p; a[1] = p;
if(pthread_create(&p->osprocid, nil, (void*(*)(void*))startprocfn, (void*)a) < 0){ if(pthread_create(&p->osprocid, nil, (void*(*)(void*))startprocfn, (void*)a) < 0){

View file

@ -8,7 +8,13 @@ case "$tag" in
*-FreeBSD-5.*) *-FreeBSD-5.*)
echo pthread.o echo pthread.o
;; ;;
*) *-Linux-*)
echo `uname`.o `uname`asm.o echo `uname`.o `uname`asm.o
;;
*-FreeBSD-*)
echo `uname`.o `uname`asm.o
;;
*)
echo pthread.o
esac esac