summaryrefslogtreecommitdiff
path: root/src/lib9
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib9')
-rw-r--r--src/lib9/_exits.c2
-rw-r--r--src/lib9/_p9dir.c2
-rw-r--r--src/lib9/atoi.c2
-rw-r--r--src/lib9/await.c1
-rw-r--r--src/lib9/cleanname.c2
-rw-r--r--src/lib9/create.c2
-rw-r--r--src/lib9/ctime.c2
-rw-r--r--src/lib9/dirfstat.c2
-rw-r--r--src/lib9/dirfwstat.c2
-rw-r--r--src/lib9/dirstat.c2
-rw-r--r--src/lib9/dirwstat.c2
-rw-r--r--src/lib9/dup.c2
-rw-r--r--src/lib9/errstr.c3
-rw-r--r--src/lib9/exec.c2
-rw-r--r--src/lib9/execl.c2
-rw-r--r--src/lib9/exitcode.c2
-rw-r--r--src/lib9/exits.c2
-rw-r--r--src/lib9/fmt/dorfmt.c1
-rw-r--r--src/lib9/fmt/errfmt.c32
-rw-r--r--src/lib9/fmt/fltfmt.c6
-rw-r--r--src/lib9/fmt/fmtfd.c2
-rw-r--r--src/lib9/fmtlock2.c2
-rw-r--r--src/lib9/getenv.c2
-rw-r--r--src/lib9/getwd.c2
-rw-r--r--src/lib9/jmp.c1
-rw-r--r--src/lib9/main.c4
-rw-r--r--src/lib9/nan.c2
-rw-r--r--src/lib9/notify.c1
-rw-r--r--src/lib9/nulldir.c2
-rw-r--r--src/lib9/open.c2
-rw-r--r--src/lib9/readn.c2
-rw-r--r--src/lib9/rfork.c1
-rw-r--r--src/lib9/run_plan9.c2
-rw-r--r--src/lib9/run_unix.c2
-rw-r--r--src/lib9/seek.c2
-rw-r--r--src/lib9/strecpy.c2
-rw-r--r--src/lib9/sysfatal.c2
-rw-r--r--src/lib9/tempdir_plan9.c2
-rw-r--r--src/lib9/tempdir_unix.c2
-rw-r--r--src/lib9/time.c2
-rw-r--r--src/lib9/tokenize.c2
-rw-r--r--src/lib9/utf/Makefile4
-rw-r--r--src/lib9/utf/runetype.c2
-rw-r--r--src/lib9/utf/runetypebody-6.3.0.h (renamed from src/lib9/utf/runetypebody-6.2.0.h)3
-rw-r--r--src/lib9/utf/utfdef.h1
-rw-r--r--src/lib9/utf/utfecpy.c4
-rw-r--r--src/lib9/utf/utflen.c1
-rw-r--r--src/lib9/utf/utfrrune.c4
-rw-r--r--src/lib9/utf/utfrune.c4
-rw-r--r--src/lib9/utf/utfutf.c3
50 files changed, 118 insertions, 22 deletions
diff --git a/src/lib9/_exits.c b/src/lib9/_exits.c
index ea8ea74e2..af55181b9 100644
--- a/src/lib9/_exits.c
+++ b/src/lib9/_exits.c
@@ -1,3 +1,5 @@
+// +build !plan9
+
/*
Plan 9 from User Space src/lib9/_exits.c
http://code.swtch.com/plan9port/src/tip/src/lib9/_exits.c
diff --git a/src/lib9/_p9dir.c b/src/lib9/_p9dir.c
index d65edcfbf..6b5a04ead 100644
--- a/src/lib9/_p9dir.c
+++ b/src/lib9/_p9dir.c
@@ -1,3 +1,5 @@
+// +build !plan9
+
/*
Plan 9 from User Space src/lib9/_p9dir.c
http://code.swtch.com/plan9port/src/tip/src/lib9/_p9dir.c
diff --git a/src/lib9/atoi.c b/src/lib9/atoi.c
index 3162b0117..5b002df75 100644
--- a/src/lib9/atoi.c
+++ b/src/lib9/atoi.c
@@ -1,3 +1,5 @@
+// +build !plan9
+
/*
Plan 9 from User Space src/lib9/ato*.c
http://code.swtch.com/plan9port/src/tip/src/lib9/atoi.c
diff --git a/src/lib9/await.c b/src/lib9/await.c
index 690a61e5c..dfb155b24 100644
--- a/src/lib9/await.c
+++ b/src/lib9/await.c
@@ -1,3 +1,4 @@
+// +build !plan9
// +build !windows
/*
diff --git a/src/lib9/cleanname.c b/src/lib9/cleanname.c
index fee40388f..cb8fce6a5 100644
--- a/src/lib9/cleanname.c
+++ b/src/lib9/cleanname.c
@@ -1,3 +1,5 @@
+// +build !plan9
+
/*
Inferno libkern/cleanname.c
http://code.google.com/p/inferno-os/source/browse/libkern/cleanname.c
diff --git a/src/lib9/create.c b/src/lib9/create.c
index d7023aea0..4ac7f7d61 100644
--- a/src/lib9/create.c
+++ b/src/lib9/create.c
@@ -1,3 +1,5 @@
+// +build !plan9
+
/*
Plan 9 from User Space src/lib9/create.c
http://code.swtch.com/plan9port/src/tip/src/lib9/create.c
diff --git a/src/lib9/ctime.c b/src/lib9/ctime.c
index 6317b594b..e16ad4a5e 100644
--- a/src/lib9/ctime.c
+++ b/src/lib9/ctime.c
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// +build !plan9
+
#define NOPLAN9DEFINES
#include <u.h>
#include <libc.h>
diff --git a/src/lib9/dirfstat.c b/src/lib9/dirfstat.c
index 8cc338409..c092a2a07 100644
--- a/src/lib9/dirfstat.c
+++ b/src/lib9/dirfstat.c
@@ -1,3 +1,5 @@
+// +build !plan9
+
/*
Plan 9 from User Space src/lib9/dirfstat.c
http://code.swtch.com/plan9port/src/tip/src/lib9/dirfstat.c
diff --git a/src/lib9/dirfwstat.c b/src/lib9/dirfwstat.c
index e32ddeaea..4666e2107 100644
--- a/src/lib9/dirfwstat.c
+++ b/src/lib9/dirfwstat.c
@@ -1,3 +1,5 @@
+// +build !plan9
+
/*
Plan 9 from User Space src/lib9/dirfwstat.c
http://code.swtch.com/plan9port/src/tip/src/lib9/dirfwstat.c
diff --git a/src/lib9/dirstat.c b/src/lib9/dirstat.c
index df2f85bd0..33f0d7cf2 100644
--- a/src/lib9/dirstat.c
+++ b/src/lib9/dirstat.c
@@ -1,3 +1,5 @@
+// +build !plan9
+
/*
Plan 9 from User Space src/lib9/dirstat.c
http://code.swtch.com/plan9port/src/tip/src/lib9/dirstat.c
diff --git a/src/lib9/dirwstat.c b/src/lib9/dirwstat.c
index 9bf348af6..22e25fff7 100644
--- a/src/lib9/dirwstat.c
+++ b/src/lib9/dirwstat.c
@@ -1,3 +1,5 @@
+// +build !plan9
+
/*
Plan 9 from User Space src/lib9/dirwstat.c
http://code.swtch.com/plan9port/src/tip/src/lib9/dirwstat.c
diff --git a/src/lib9/dup.c b/src/lib9/dup.c
index 9fdfdb8d1..5cac831d6 100644
--- a/src/lib9/dup.c
+++ b/src/lib9/dup.c
@@ -1,3 +1,5 @@
+// +build !plan9
+
/*
Plan 9 from User Space src/lib9/dup.c
http://code.swtch.com/plan9port/src/tip/src/lib9/dup.c
diff --git a/src/lib9/errstr.c b/src/lib9/errstr.c
index f42f2b538..9d919755d 100644
--- a/src/lib9/errstr.c
+++ b/src/lib9/errstr.c
@@ -1,3 +1,5 @@
+// +build !plan9
+
/*
Plan 9 from User Space src/lib9/errstr.c
http://code.swtch.com/plan9port/src/tip/src/lib9/errstr.c
@@ -32,7 +34,6 @@ THE SOFTWARE.
#include <u.h>
#include <errno.h>
-#include <string.h>
#include <libc.h>
enum
diff --git a/src/lib9/exec.c b/src/lib9/exec.c
index f2ad0f9b3..8e5fc5784 100644
--- a/src/lib9/exec.c
+++ b/src/lib9/exec.c
@@ -1,3 +1,5 @@
+// +build !plan9
+
/*
Plan 9 from User Space src/lib9/exec.c
http://code.swtch.com/plan9port/src/tip/src/lib9/exec.c
diff --git a/src/lib9/execl.c b/src/lib9/execl.c
index 81d315883..fd4d23daa 100644
--- a/src/lib9/execl.c
+++ b/src/lib9/execl.c
@@ -1,3 +1,5 @@
+// +build !plan9
+
/*
Plan 9 from User Space src/lib9/execl.c
http://code.swtch.com/plan9port/src/tip/src/lib9/execl.c
diff --git a/src/lib9/exitcode.c b/src/lib9/exitcode.c
index a952b2da2..fc863445f 100644
--- a/src/lib9/exitcode.c
+++ b/src/lib9/exitcode.c
@@ -1,3 +1,5 @@
+// +build !plan9
+
/*
Plan 9 from User Space src/lib9/exitcode.c
http://code.swtch.com/plan9port/src/tip/src/lib9/exitcode.c
diff --git a/src/lib9/exits.c b/src/lib9/exits.c
index 5caef8309..0be7cb9f1 100644
--- a/src/lib9/exits.c
+++ b/src/lib9/exits.c
@@ -1,3 +1,5 @@
+// +build !plan9
+
/*
Plan 9 from User Space src/lib9/_exits.c
http://code.swtch.com/plan9port/src/tip/src/lib9/_exits.c
diff --git a/src/lib9/fmt/dorfmt.c b/src/lib9/fmt/dorfmt.c
index c18d9ee5d..f760d47e5 100644
--- a/src/lib9/fmt/dorfmt.c
+++ b/src/lib9/fmt/dorfmt.c
@@ -61,5 +61,4 @@ dorfmt(Fmt *f, const Rune *fmt)
if(fmt == nil)
return -1;
}
- return 0; /* not reached */
}
diff --git a/src/lib9/fmt/errfmt.c b/src/lib9/fmt/errfmt.c
new file mode 100644
index 000000000..a86709398
--- /dev/null
+++ b/src/lib9/fmt/errfmt.c
@@ -0,0 +1,32 @@
+// +build plan9
+
+/*
+ * The authors of this software are Rob Pike and Ken Thompson,
+ * with contributions from Mike Burrows and Sean Dorward.
+ *
+ * Copyright (c) 2002-2006 by Lucent Technologies.
+ * Portions Copyright (c) 2004 Google Inc.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose without fee is hereby granted, provided that this entire notice
+ * is included in all copies of any software which is or includes a copy
+ * or modification of this software and in all copies of the supporting
+ * documentation for such software.
+ * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
+ * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES
+ * NOR GOOGLE INC MAKE ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING
+ * THE MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
+ */
+
+#include <u.h>
+#include <libc.h>
+#include "fmtdef.h"
+
+int
+__errfmt(Fmt *f)
+{
+ char buf[ERRMAX];
+
+ rerrstr(buf, sizeof buf);
+ return __fmtcpy(f, buf, utflen(buf), strlen(buf));
+}
diff --git a/src/lib9/fmt/fltfmt.c b/src/lib9/fmt/fltfmt.c
index dec6f8480..6fe819221 100644
--- a/src/lib9/fmt/fltfmt.c
+++ b/src/lib9/fmt/fltfmt.c
@@ -154,6 +154,7 @@ xsub1(char *a, int n)
* so that it has a nonzero first digit.
*/
abort();
+ return 0;
}
/*
@@ -180,7 +181,7 @@ xfmtexp(char *p, int e, int ucase)
se[i++] = '0';
while(i > 0)
*p++ = se[--i];
- *p++ = '\0';
+ *p = '\0';
}
/*
@@ -192,7 +193,8 @@ xfmtexp(char *p, int e, int ucase)
static void
xdtoa(double f, char *s, int *exp, int *neg, int *ns)
{
- int d, e2, e, ee, i, ndigit, oerrno;
+ int d, e2, e, ee, i, ndigit;
+ int oerrno;
char c;
char tmp[NSIGNIF+10];
double g;
diff --git a/src/lib9/fmt/fmtfd.c b/src/lib9/fmt/fmtfd.c
index c32abf115..dde05b7a5 100644
--- a/src/lib9/fmt/fmtfd.c
+++ b/src/lib9/fmt/fmtfd.c
@@ -43,7 +43,7 @@ fmtfdinit(Fmt *f, int fd, char *buf, int size)
f->to = buf;
f->stop = buf + size;
f->flush = __fmtFdFlush;
- f->farg = (void*)(uintptr_t)fd;
+ f->farg = (void*)(uintptr)fd;
f->flags = 0;
f->nfmt = 0;
fmtlocaleinit(f, nil, nil, nil);
diff --git a/src/lib9/fmtlock2.c b/src/lib9/fmtlock2.c
index 75406b5d1..a0e2636ec 100644
--- a/src/lib9/fmtlock2.c
+++ b/src/lib9/fmtlock2.c
@@ -1,3 +1,5 @@
+// +build !plan9
+
/*
Plan 9 from User Space src/lib9/fmtlock2.c
http://code.swtch.com/plan9port/src/tip/src/lib9/fmtlock2.c
diff --git a/src/lib9/getenv.c b/src/lib9/getenv.c
index 9d805b516..2454b6b41 100644
--- a/src/lib9/getenv.c
+++ b/src/lib9/getenv.c
@@ -1,3 +1,5 @@
+// +build !plan9
+
/*
Plan 9 from User Space src/lib9/getenv.c
http://code.swtch.com/plan9port/src/tip/src/lib9/getenv.c
diff --git a/src/lib9/getwd.c b/src/lib9/getwd.c
index cbfd9d643..03a8ff1a2 100644
--- a/src/lib9/getwd.c
+++ b/src/lib9/getwd.c
@@ -1,3 +1,5 @@
+// +build !plan9
+
/*
Plan 9 from User Space src/lib9/getwd.c
http://code.swtch.com/plan9port/src/tip/src/lib9/getwd.c
diff --git a/src/lib9/jmp.c b/src/lib9/jmp.c
index c44e040d2..733ed70e9 100644
--- a/src/lib9/jmp.c
+++ b/src/lib9/jmp.c
@@ -1,3 +1,4 @@
+// +build !plan9
// +build !windows
/*
diff --git a/src/lib9/main.c b/src/lib9/main.c
index 816494af0..088b09523 100644
--- a/src/lib9/main.c
+++ b/src/lib9/main.c
@@ -1,3 +1,5 @@
+// +build !plan9
+
/*
Plan 9 from User Space src/lib9/main.c
http://code.swtch.com/plan9port/src/tip/src/lib9/main.c
@@ -50,8 +52,8 @@ main(int argc, char **argv)
// don't display the crash dialog
DWORD mode = SetErrorMode(SEM_NOGPFAULTERRORBOX);
SetErrorMode(mode | SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX | SEM_NOOPENFILEERRORBOX);
- argv0 = argv[0];
#endif
+ argv0 = argv[0];
p9main(argc, argv);
exits("main");
return 99;
diff --git a/src/lib9/nan.c b/src/lib9/nan.c
index fa2277f72..f17b441aa 100644
--- a/src/lib9/nan.c
+++ b/src/lib9/nan.c
@@ -1,3 +1,5 @@
+// +build !plan9
+
/*
Plan 9 from User Space src/lib9/nan.c
http://code.swtch.com/plan9port/src/tip/src/lib9/nan.c
diff --git a/src/lib9/notify.c b/src/lib9/notify.c
index c424aed54..7843d3471 100644
--- a/src/lib9/notify.c
+++ b/src/lib9/notify.c
@@ -1,3 +1,4 @@
+// +build !plan9
// +build !windows
/*
diff --git a/src/lib9/nulldir.c b/src/lib9/nulldir.c
index aa1a1232e..2157ff313 100644
--- a/src/lib9/nulldir.c
+++ b/src/lib9/nulldir.c
@@ -1,3 +1,5 @@
+// +build !plan9
+
/*
Inferno lib9/nulldir.c
http://code.google.com/p/inferno-os/source/browse/lib9/nulldir.c
diff --git a/src/lib9/open.c b/src/lib9/open.c
index 4ac81ba5f..7f53c8ea6 100644
--- a/src/lib9/open.c
+++ b/src/lib9/open.c
@@ -1,3 +1,5 @@
+// +build !plan9
+
/*
Plan 9 from User Space src/lib9/open.c
http://code.swtch.com/plan9port/src/tip/src/lib9/open.c
diff --git a/src/lib9/readn.c b/src/lib9/readn.c
index 3c80a4fc0..7dfe9e515 100644
--- a/src/lib9/readn.c
+++ b/src/lib9/readn.c
@@ -1,3 +1,5 @@
+// +build !plan9
+
/*
Inferno lib9/readn.c
http://code.google.com/p/inferno-os/source/browse/lib9/readn.c
diff --git a/src/lib9/rfork.c b/src/lib9/rfork.c
index c4ae90f97..23b3ee671 100644
--- a/src/lib9/rfork.c
+++ b/src/lib9/rfork.c
@@ -1,3 +1,4 @@
+// +build !plan9
// +build !windows
/*
diff --git a/src/lib9/run_plan9.c b/src/lib9/run_plan9.c
index cd85652f7..29932626d 100644
--- a/src/lib9/run_plan9.c
+++ b/src/lib9/run_plan9.c
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// +build plan9
+
#include <u.h>
#include <libc.h>
diff --git a/src/lib9/run_unix.c b/src/lib9/run_unix.c
index 3db33c76e..1acaefed8 100644
--- a/src/lib9/run_unix.c
+++ b/src/lib9/run_unix.c
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build darwin dragonfly freebsd linux netbsd openbsd
+// +build darwin dragonfly freebsd linux netbsd openbsd solaris
#include <u.h>
#include <errno.h>
diff --git a/src/lib9/seek.c b/src/lib9/seek.c
index 917003808..0a0706cbe 100644
--- a/src/lib9/seek.c
+++ b/src/lib9/seek.c
@@ -1,3 +1,5 @@
+// +build !plan9
+
/*
Plan 9 from User Space src/lib9/seek.c
http://code.swtch.com/plan9port/src/tip/src/lib9/seek.c
diff --git a/src/lib9/strecpy.c b/src/lib9/strecpy.c
index 03dc6ea50..4b2b92b43 100644
--- a/src/lib9/strecpy.c
+++ b/src/lib9/strecpy.c
@@ -1,3 +1,5 @@
+// +build !plan9
+
/*
Inferno lib9/strecpy.c
http://code.google.com/p/inferno-os/source/browse/lib9/strecpy.c
diff --git a/src/lib9/sysfatal.c b/src/lib9/sysfatal.c
index a5af3e1b4..9789061a8 100644
--- a/src/lib9/sysfatal.c
+++ b/src/lib9/sysfatal.c
@@ -1,3 +1,5 @@
+// +build !plan9
+
/*
Plan 9 from User Space src/lib9/sysfatal.c
http://code.swtch.com/plan9port/src/tip/src/lib9/sysfatal.c
diff --git a/src/lib9/tempdir_plan9.c b/src/lib9/tempdir_plan9.c
index 092d00d16..80d7ddbe4 100644
--- a/src/lib9/tempdir_plan9.c
+++ b/src/lib9/tempdir_plan9.c
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// +build plan9
+
#include <u.h>
#include <libc.h>
diff --git a/src/lib9/tempdir_unix.c b/src/lib9/tempdir_unix.c
index 3ce87751b..269d53823 100644
--- a/src/lib9/tempdir_unix.c
+++ b/src/lib9/tempdir_unix.c
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build darwin dragonfly freebsd linux netbsd openbsd
+// +build darwin dragonfly freebsd linux netbsd openbsd solaris
#include <u.h>
#include <dirent.h>
diff --git a/src/lib9/time.c b/src/lib9/time.c
index 7394e9e60..e1b87a774 100644
--- a/src/lib9/time.c
+++ b/src/lib9/time.c
@@ -1,3 +1,5 @@
+// +build !plan9
+
/*
Plan 9 from User Space src/lib9/time.c
http://code.swtch.com/plan9port/src/tip/src/lib9/time.c
diff --git a/src/lib9/tokenize.c b/src/lib9/tokenize.c
index a9b593567..a095fcda9 100644
--- a/src/lib9/tokenize.c
+++ b/src/lib9/tokenize.c
@@ -1,3 +1,5 @@
+// +build !plan9
+
/*
Inferno lib9/tokenize.c
http://code.google.com/p/inferno-os/source/browse/lib9/tokenize.c
diff --git a/src/lib9/utf/Makefile b/src/lib9/utf/Makefile
index 5c9cdf051..fe6f6351a 100644
--- a/src/lib9/utf/Makefile
+++ b/src/lib9/utf/Makefile
@@ -21,10 +21,10 @@ runetypebody-%.h: mkrunetype UnicodeData-%.txt
CLEANFILES+=UnicodeData.txt
-UNICODE_VERSION=6.2.0
+UNICODE_VERSION=6.3.0
test: mkrunetype UnicodeData-$(UNICODE_VERSION).txt
mkrunetype -c UnicodeData-$(UNICODE_VERSION).txt
clean:
- rm -f UnicodeData.txt mkrunetype \ No newline at end of file
+ rm -f UnicodeData.txt mkrunetype
diff --git a/src/lib9/utf/runetype.c b/src/lib9/utf/runetype.c
index b3634965f..ed775af08 100644
--- a/src/lib9/utf/runetype.c
+++ b/src/lib9/utf/runetype.c
@@ -35,4 +35,4 @@ rbsearch(Rune c, Rune *t, int n, int ne)
return 0;
}
-#include "runetypebody-6.2.0.h"
+#include "runetypebody-6.3.0.h"
diff --git a/src/lib9/utf/runetypebody-6.2.0.h b/src/lib9/utf/runetypebody-6.3.0.h
index a603af0df..5554dca36 100644
--- a/src/lib9/utf/runetypebody-6.2.0.h
+++ b/src/lib9/utf/runetypebody-6.3.0.h
@@ -1,4 +1,4 @@
-/* generated automatically by mkrunetype.c from UnicodeData-6.2.0.txt */
+/* generated automatically by mkrunetype.c from UnicodeData-6.3.0.txt */
static Rune __isspacer[] = {
0x0009, 0x000d,
@@ -6,7 +6,6 @@ static Rune __isspacer[] = {
0x0085, 0x0085,
0x00a0, 0x00a0,
0x1680, 0x1680,
- 0x180e, 0x180e,
0x2000, 0x200a,
0x2028, 0x2029,
0x202f, 0x202f,
diff --git a/src/lib9/utf/utfdef.h b/src/lib9/utf/utfdef.h
index adc6d95fb..4bbdfc643 100644
--- a/src/lib9/utf/utfdef.h
+++ b/src/lib9/utf/utfdef.h
@@ -25,4 +25,3 @@ typedef unsigned int uint;
typedef unsigned long ulong;
#define nelem(x) (sizeof(x)/sizeof((x)[0]))
-#define nil ((void*)0)
diff --git a/src/lib9/utf/utfecpy.c b/src/lib9/utf/utfecpy.c
index 2eca85ef6..854066460 100644
--- a/src/lib9/utf/utfecpy.c
+++ b/src/lib9/utf/utfecpy.c
@@ -11,8 +11,8 @@
* REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
* OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
*/
-#define _BSD_SOURCE 1
-#include <string.h>
+#include <u.h>
+#include <libc.h>
#include "utf.h"
#include "utfdef.h"
diff --git a/src/lib9/utf/utflen.c b/src/lib9/utf/utflen.c
index 42fcb33ab..9b961856a 100644
--- a/src/lib9/utf/utflen.c
+++ b/src/lib9/utf/utflen.c
@@ -32,5 +32,4 @@ utflen(const char *s)
s += chartorune(&rune, s);
n++;
}
- return 0;
}
diff --git a/src/lib9/utf/utfrrune.c b/src/lib9/utf/utfrrune.c
index 9e28af82a..b1ea93b42 100644
--- a/src/lib9/utf/utfrrune.c
+++ b/src/lib9/utf/utfrrune.c
@@ -11,7 +11,8 @@
* REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
* OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
*/
-#include <string.h>
+#include <u.h>
+#include <libc.h>
#include "utf.h"
#include "utfdef.h"
@@ -42,5 +43,4 @@ utfrrune(const char *s, Rune c)
s1 = s;
s += c1;
}
- return 0;
}
diff --git a/src/lib9/utf/utfrune.c b/src/lib9/utf/utfrune.c
index 0136b2821..44675c989 100644
--- a/src/lib9/utf/utfrune.c
+++ b/src/lib9/utf/utfrune.c
@@ -11,7 +11,8 @@
* REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
* OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
*/
-#include <string.h>
+#include <u.h>
+#include <libc.h>
#include "utf.h"
#include "utfdef.h"
@@ -41,5 +42,4 @@ utfrune(const char *s, Rune c)
return (char*)s;
s += n;
}
- return 0;
}
diff --git a/src/lib9/utf/utfutf.c b/src/lib9/utf/utfutf.c
index e46ddd923..05335b23e 100644
--- a/src/lib9/utf/utfutf.c
+++ b/src/lib9/utf/utfutf.c
@@ -11,7 +11,8 @@
* REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
* OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
*/
-#include <string.h>
+#include <u.h>
+#include <libc.h>
#include "utf.h"
#include "utfdef.h"