aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2004-12-26 21:50:39 +0000
committerrsc <devnull@localhost>2004-12-26 21:50:39 +0000
commitb2ff5382580e13d82ca48966c9d79d3318865cba (patch)
tree402311b76a04e7bb01f3f233cb7e51484f79e5a9
parentbd36f714d22b1a6046b528649d5e962e038e4d13 (diff)
downloadplan9port-b2ff5382580e13d82ca48966c9d79d3318865cba.tar.gz
plan9port-b2ff5382580e13d82ca48966c9d79d3318865cba.tar.bz2
plan9port-b2ff5382580e13d82ca48966c9d79d3318865cba.zip
add for unix port
-rw-r--r--src/lib9/fmt/plan9.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/lib9/fmt/plan9.h b/src/lib9/fmt/plan9.h
new file mode 100644
index 00000000..f9762889
--- /dev/null
+++ b/src/lib9/fmt/plan9.h
@@ -0,0 +1,33 @@
+/*
+ * compiler directive on Plan 9
+ */
+#ifndef USED
+#define USED(x) if(x);else
+#endif
+
+/*
+ * easiest way to make sure these are defined
+ */
+#define uchar _fmtuchar
+#define ushort _fmtushort
+#define uint _fmtuint
+#define ulong _fmtulong
+#define vlong _fmtvlong
+#define uvlong _fmtuvlong
+typedef unsigned char uchar;
+typedef unsigned short ushort;
+typedef unsigned int uint;
+typedef unsigned long ulong;
+typedef unsigned long long uvlong;
+typedef long long vlong;
+
+/*
+ * nil cannot be ((void*)0) on ANSI C,
+ * because it is used for function pointers
+ */
+#undef nil
+#define nil 0
+
+#undef nelem
+#define nelem(x) (sizeof (x)/sizeof (x)[0])
+