Bläddra i källkod

quick and dirty patch to avoid treating stdout as a constant

Michael van Elst 22 år sedan
förälder
incheckning
e029d5ba9b
2 ändrade filer med 31 tillägg och 1 borttagningar
  1. 28 0
      njmc/njmc.patch
  2. 3 1
      njmc/njmc.spec

+ 28 - 0
njmc/njmc.patch

@@ -0,0 +1,28 @@
+--- base/mclib.c.dist	2003-06-14 12:18:31.000000000 +0200
++++ base/mclib.c	2003-06-14 12:18:21.000000000 +0200
+@@ -473,13 +473,12 @@
+ }
+ #line 1016 "mclib.nw"
+ static void label_print(struct label *label) {
+-  asmprintf(asmprintfd, "%s", label->name ? label->name : "???");
++  asmprintf(stdout, "%s", label->name ? label->name : "???");
+ }
+ #line 1022 "mclib.nw"
+ typedef void (*asmprinter)(void *closure, const char *fmt, ...);
+ extern int fprintf(FILE *stream, const char *fmt, ...); /* needed at Purdue -- ugh */
+ void (*asmprintf)(void *closure, const char *fmt, ...) = (asmprinter) fprintf;
+-void *asmprintfd = (void *)stdout;
+ void (*asmprintreloc)(RAddr reloc) = reloc_print; /* calls asmprintf */
+ #line 79 "reloc.nw"
+ RAddr addr_new(label, offset) RLabel label; int offset; {
+@@ -493,8 +492,8 @@
+ #line 100 "reloc.nw"
+ static void reloc_print(RAddr addr) {
+   label_print(addr->label);
+-  if (addr->offset > 0) asmprintf(asmprintfd, "+%d", addr->offset);
+-  if (addr->offset < 0) asmprintf(asmprintfd,  "%d", addr->offset);
++  if (addr->offset > 0) asmprintf(stdout, "+%d", addr->offset);
++  if (addr->offset < 0) asmprintf(stdout,  "%d", addr->offset);
+ }
+ #line 113 "reloc.nw"
+ RAddr unsigned_to_raddr(unsigned lc) {

+ 3 - 1
njmc/njmc.spec

@@ -33,11 +33,12 @@ Distribution: OpenPKG [EVAL]
 Group:        Compiler
 License:      GPL
 Version:      0.5
-Release:      20020717
+Release:      20030614
 
 #   list of sources
 Source0:      http://www.eecs.harvard.edu/~nr/toolkit/base.tar.gz
 Source1:      http://www.eecs.harvard.edu/~nr/toolkit/base-specs.tar.gz
+Patch0:       njmc.patch
 
 #   build information
 Prefix:       %{l_prefix}
@@ -58,6 +59,7 @@ AutoReqProv:  no
 %prep
     %setup0 -q -c
     %setup1 -q -T -D -a 1
+    %patch0 -p0
 
 %build
     cd base