ref: 44782f552869c57f38876fdeafcce9de167df6c3
parent: daadb0a1ab632a225059a48d7d9d725a03e621f2
parent: 249ff28f6199e0562c5630f6dd0d17da261db4c9
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Mon Jan 25 13:52:27 EST 2021
Merge commit '249ff28f6199e0562c5630f6dd0d17da261db4c9'
--- a/c9/c9.c
+++ b/c9/c9.c
@@ -5,8 +5,13 @@
* any sense to copy-paste protocol documentation, which
* you can read at http://man.cat-v.org/plan_9/5/, see 'intro'.
*/
+#ifdef __plan9__
+#include <u.h>
+#include <libc.h>
+#else
#include <stdint.h>
#include <string.h>
+#endif
#include "c9.h"
enum
@@ -717,10 +722,9 @@
C9error
s9flush(C9ctx *c, C9tag tag)
{
- uint8_t *b;
C9error err;
- if((b = R(c, 0, Rflush, tag, &err)) != NULL)
+ if(R(c, 0, Rflush, tag, &err) != NULL)
err = c->end(c);
return err;
}
@@ -880,10 +884,9 @@
C9error
s9clunk(C9ctx *c, C9tag tag)
{
- uint8_t *b;
C9error err;
- if((b = R(c, 0, Rclunk, tag, &err)) != NULL)
+ if(R(c, 0, Rclunk, tag, &err) != NULL)
err = c->end(c);
return err;
}
@@ -891,10 +894,9 @@
C9error
s9remove(C9ctx *c, C9tag tag)
{
- uint8_t *b;
C9error err;
- if((b = R(c, 0, Rremove, tag, &err)) != NULL)
+ if(R(c, 0, Rremove, tag, &err) != NULL)
err = c->end(c);
return err;
}
@@ -943,10 +945,9 @@
C9error
s9wstat(C9ctx *c, C9tag tag)
{
- uint8_t *b;
C9error err;
- if((b = R(c, 0, Rwstat, tag, &err)) != NULL)
+ if(R(c, 0, Rwstat, tag, &err) != NULL)
err = c->end(c);
return err;
}
--- a/c9/c9.h
+++ b/c9/c9.h
@@ -1,3 +1,12 @@
+#ifdef __plan9__
+typedef u64int uint64_t;
+typedef u32int uint32_t;
+typedef u16int uint16_t;
+typedef u8int uint8_t;
+#define __attribute__(...)
+#define NULL nil
+#endif
+
struct C9aux;
typedef struct C9r C9r;