ref: 70eb96f88f3c6fa0f66d67ba469a07cfa4e13193
parent: 5cca8cb85bf2fe2e299301c7c75892d9b6f6504b
author: henesy <henesy.dev@gmail.com>
date: Fri Sep 12 04:32:28 EDT 2025
plan9/386: fix build on 9front/386 tip
--- a/emu/port/devdraw.c
+++ b/emu/port/devdraw.c
@@ -33,7 +33,9 @@
#define NHASH (1<<5)
#define HASHMASK (NHASH-1)
+#ifndef PLAN9
#define IOUNIT (64*1024)
+#endif
typedef struct Client Client;
typedef struct Draw Draw;
--- a/emu/port/fns.h
+++ b/emu/port/fns.h
@@ -20,7 +20,9 @@
void cinit(void);
char* clipread(void);
int clipwrite(char*);
+#ifndef PLAN9
void (*coherence)(void);
+#endif
void copen(Chan*);
void cmderror(Cmdbuf*, char*);
Block* concatblock(Block*);
--- a/emu/port/main.c
+++ b/emu/port/main.c
@@ -239,8 +239,10 @@
char *enva[20];
int envc;
+ #ifndef PLAN9
if(coherence == nil)
coherence = nofence;
+ #endif
quotefmtinstall();
savestartup(argc, argv);
/* set default root now, so either $EMU or -r can override it later */
@@ -434,6 +436,7 @@
/*
* mainly for libmp
*/
+#ifndef PLAN9
void
sysfatal(char *fmt, ...)
{
@@ -445,6 +448,7 @@
va_end(arg);
error(buf);
}
+#endif
void
oserror(void)
--- a/libkern/qsort.c
+++ b/libkern/qsort.c
@@ -109,6 +109,7 @@
}
}
+#ifndef PLAN9
void
qsort(void *va, long n, long es, int (*cmp)(void*, void*))
{
@@ -121,3 +122,4 @@
s.swap = swapb;
qsorts((char*)va, n, &s);
}
+#endif
--- a/mkfiles/mkfile-Plan9-386
+++ b/mkfiles/mkfile-Plan9-386
@@ -12,7 +12,7 @@
ASFLAGS=
CC= 8c
-CFLAGS= -wFVT -I$ROOT/Plan9/$OBJTYPE/include -I$ROOT/Plan9/include -I$ROOT/include
+CFLAGS= -wFVT -DPLAN9 -I$ROOT/Plan9/$OBJTYPE/include -I$ROOT/Plan9/include -I$ROOT/include
ANSICPP= -p
LD= 8l
--
⑨