summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2012-10-19 03:04:44 -0400
committerOri Bernstein <ori@eigenstate.org>2012-10-19 03:04:44 -0400
commit43149c34053a8ba8320d2b021ca6d6ba86601985 (patch)
tree9b14eeffda34a5300e1c3888f6910f015c3a8d83
parent6af02a3600c74a974bfdcec12ead515a611a0234 (diff)
downloadmc-43149c34053a8ba8320d2b021ca6d6ba86601985.tar.gz
Search default system include path last.
We used to search the system include path before any user specified ones. This doesn't allow us to override the system libraries. Fix the search order.
-rw-r--r--6/main.c2
-rw-r--r--libstd/Makefile1
-rw-r--r--libstd/fmt.myr4
-rw-r--r--libstd/test.myr9
-rw-r--r--muse/muse.c2
5 files changed, 15 insertions, 3 deletions
diff --git a/6/main.c b/6/main.c
index bf09e5e..c019a37 100644
--- a/6/main.c
+++ b/6/main.c
@@ -58,7 +58,6 @@ int main(int argc, char **argv)
Stab *globls;
char buf[1024];
- lappend(&incpaths, &nincpaths, Instroot "/lib/myr");
while ((opt = getopt(argc, argv, "d::hSo:I:")) != -1) {
switch (opt) {
case 'o':
@@ -86,6 +85,7 @@ int main(int argc, char **argv)
}
}
+ lappend(&incpaths, &nincpaths, Instroot "/lib/myr");
for (i = optind; i < argc; i++) {
globls = mkstab();
tyinit(globls);
diff --git a/libstd/Makefile b/libstd/Makefile
index 7b20c47..eea3b87 100644
--- a/libstd/Makefile
+++ b/libstd/Makefile
@@ -46,7 +46,6 @@ clean:
rm -f $(JUNKASM) test.s
rm -f lib$(MYRLIB).a
-
install:
mkdir -p $(INST_ROOT)/lib/myr
install libstd.a $(INST_ROOT)/lib/myr
diff --git a/libstd/fmt.myr b/libstd/fmt.myr
index 5478c22..d257d0a 100644
--- a/libstd/fmt.myr
+++ b/libstd/fmt.myr
@@ -32,6 +32,7 @@ const bfmtv = {buf, fmt, ap
var i_val : int32
var l_val : int64
var p_val : byte*
+ var c_val : char
n = 0
while fmt.len
@@ -64,6 +65,9 @@ const bfmtv = {buf, fmt, ap
(p_val, ap) = vanext(ap)
n += intfmt(buf[n:], p_val castto(int64), 16)
;;
+ 'c': (c_val, ap) = vanext(ap)
+ n += encode(buf[n:], c)
+ ;;
_:
die("Unknown format specifier")
;;
diff --git a/libstd/test.myr b/libstd/test.myr
index e3bbe46..7e50836 100644
--- a/libstd/test.myr
+++ b/libstd/test.myr
@@ -4,11 +4,20 @@ const main = {args : byte[:][:]
var x : byte*[1024]
var sz
var i
+ var opt
+ var o
std.put("args.len = %i\n", args.len)
for i = 0; i < args.len; i++
std.put("args[%i] = %s\n", i, args[i])
;;
+
+ opt = std.optinit("asdf:", args)
+ while (o = std.optnext(opt)) != std.Badchar
+ std.put("option %c\n", o)
+ ;;
+
+
/* try the byte allocator for large variety of sizes. */
for sz = 1; sz < 65536; sz *= 2
for i = 0; i < 1024; i++
diff --git a/muse/muse.c b/muse/muse.c
index b586641..77fdb99 100644
--- a/muse/muse.c
+++ b/muse/muse.c
@@ -89,7 +89,6 @@ int main(int argc, char **argv)
int opt;
int i;
- lappend(&incpaths, &nincpaths, Instroot "/lib/myr");
while ((opt = getopt(argc, argv, "d::hmo:I:")) != -1) {
switch (opt) {
case 'h':
@@ -117,6 +116,7 @@ int main(int argc, char **argv)
}
}
+ lappend(&incpaths, &nincpaths, Instroot "/lib/myr");
if (merge) {
if (!outfile) {
fprintf(stderr, "Output file needed when merging usefiles.");