Fix 2004/jdalbec for gcc
GCC objected to the '##' and some other cpp directives that were being used. This unfortunately did mess up the formatting of the some of the code but I tried to preserve the art and the periodic table of elements formatting (this was preserved but whether I got all the art or not preserved I do not know) as these parts seemed too important to not preserve.
This commit is contained in:
1 parent
bd5656efc4
commit
a875bde4d0
2 files changed
+51
-56
No files matched your search
+25
-56
@@ -1,28 +1,25 @@
|
|||||||
#define Nd Np define
|
??= define Ba BC(B, I)
|
||||||
#define Np ??=
|
??= define Be BC(Br, I)
|
||||||
|
??= define Ca(C, Ca) CB(B, In C, Ca)
|
||||||
Nd Ba BC(B, I)
|
??= define Cl(Cl) Cl Cl
|
||||||
Nd Be BC(Br, I)
|
??= define Cs const
|
||||||
Nd Ca(C, Ca) CB(B, In C, Ca)
|
??= define FrB N = Zr; Fr((O, B = BrB(BrF, I)))
|
||||||
Nd Cl(Cl) Cl Cl
|
??= define Fe(F) FO (In = Zr; F; In++)
|
||||||
Nd Cs const
|
??= define FF FB(B); FB(BF);
|
||||||
Nd FrB N = Zr; Fr((O, B = BrB(BrF, I)))
|
??= define FI Fe(IO)
|
||||||
Nd Fe(F) FO (In = Zr; F; In++)
|
??= define FO for
|
||||||
Nd FF FB(B); FB(BF);
|
??= define Fr(F) FO (I = Zr; F; I++)
|
||||||
Nd FI Fe(IO)
|
??= define II I I, In
|
||||||
Nd FO for
|
??= define In(I, Ir) main(I, Ir)
|
||||||
Nd Fr(F) FO (I = Zr; F; I++)
|
??= define IO In[O[C + I]]
|
||||||
Nd II I I, In
|
??= define Ir(I) if (I)
|
||||||
Nd In(I, Ir) main(I, Ir)
|
??= define Nb N > N && N > -O
|
||||||
Nd IO In[O[C + I]]
|
??= define Rb(Rb, B) BBr(Br, Rb, B)
|
||||||
Nd Ir(I) if (I)
|
??= define Re return
|
||||||
Nd Nb N > N && N > -O
|
??= define Sc struct
|
||||||
Nd Rb(Rb, B) BBr(Br, Rb, B)
|
??= define Si(Te) sizeof (Te)
|
||||||
Nd Re return
|
??= define Te typedef
|
||||||
Nd Sc struct
|
??= define Zn N < Zr
|
||||||
Nd Si(Te) sizeof (Te)
|
|
||||||
Nd Te typedef
|
|
||||||
Nd Zn N < Zr
|
|
||||||
|
|
||||||
Te char C;
|
Te char C;
|
||||||
Te int I;
|
Te int I;
|
||||||
@@ -54,37 +51,7 @@ V *(*Mo)(Si) = malloc;
|
|||||||
I (*Pr)(Cs C *, ...) = printf;
|
I (*Pr)(Cs C *, ...) = printf;
|
||||||
I (*P)(I) = putchar;
|
I (*P)(I) = putchar;
|
||||||
|
|
||||||
Nd Tm(B,C) \
|
??= define Tm(B,C) Sc B { C *B; I N; } ; Te Sc B *B; B N##B (I) ; V F##B (B) ; C B##C (B, I) ; V C##B (B, I, C) ; B N##B (I N) { B B; Re (W, B = Mo(Si(Sc B))) ? (O, B->B = Mo(((W, B->N = N) ? N : O) * Si(C))) ? B Cl(: (At(), B)); } V F##B (B B) { F(B->B); F(B); } C B##C (B B, I N) { Re B->Nb ? B->B[N] : (C) Zr; } V C##B (B B, I N, C C) { N; B->Nb ? B->B[N] = C : C ? At(), C : C; }
|
||||||
Sc B { \
|
|
||||||
C *B; \
|
|
||||||
I N; \
|
|
||||||
} ; \
|
|
||||||
Te Sc B *B; \
|
|
||||||
\
|
|
||||||
B N##B (I) ; \
|
|
||||||
V F##B (B) ; \
|
|
||||||
C B##C (B, I) ; \
|
|
||||||
V C##B (B, I, C) ; \
|
|
||||||
\
|
|
||||||
B N##B (I N) { \
|
|
||||||
B B; \
|
|
||||||
\
|
|
||||||
Re (W, B = Mo(Si(Sc B))) ? \
|
|
||||||
(O, B->B = Mo(((W, B->N = N) ? N : O) * Si(C))) ? \
|
|
||||||
B Cl(: (At(), B)); \
|
|
||||||
} \
|
|
||||||
V F##B (B B) { \
|
|
||||||
F(B->B); \
|
|
||||||
F(B); \
|
|
||||||
} \
|
|
||||||
C B##C (B B, I N) { \
|
|
||||||
Re B->Nb ? B->B[N] : (C) Zr; \
|
|
||||||
} \
|
|
||||||
V C##B (B B, I N, C C) { \
|
|
||||||
N; \
|
|
||||||
B->Nb ? B->B[N] = C : C ? At(), C : C; \
|
|
||||||
}
|
|
||||||
|
|
||||||
Tm(B,C)
|
Tm(B,C)
|
||||||
|
|
||||||
V Pb (B) ;
|
V Pb (B) ;
|
||||||
@@ -240,5 +207,7 @@ I In (I N, C ** C) {
|
|||||||
{ } { { } } { } { } { } { } { } { } { } { } { { } }
|
{ } { { } } { } { } { } { } { } { } { } { } { { } }
|
||||||
{ } { } { } { } { } { } { } { } { } { } { }
|
{ } { } { } { } { } { } { } { } { } { } { }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Re Zr;
|
Re Zr;
|
||||||
}
|
}
|
||||||
@@ -1001,6 +1001,32 @@ provided, found under the [img/](2004/gavin/img/) directory. Note that the
|
|||||||
done this way to prevent extraction from the entry directory overwriting the
|
done this way to prevent extraction from the entry directory overwriting the
|
||||||
files and causing `make clobber` to wipe some of them out.
|
files and causing `make clobber` to wipe some of them out.
|
||||||
|
|
||||||
|
## [2004/jdalbec](2004/jdalbec/jdalbec.c) ([README.md](2004/jdalbec/README.md))
|
||||||
|
|
||||||
|
Cody fixed this to compile with gcc (it worked with clang). The problem was the
|
||||||
|
cpp being unable to parse the generated code (see the README.md for details) and
|
||||||
|
this ended up with a number of errors like:
|
||||||
|
|
||||||
|
|
||||||
|
```c
|
||||||
|
jdalbec.c:64:5: error: stray '##' in program
|
||||||
|
64 | B N##B (I) ; \
|
||||||
|
| ^~
|
||||||
|
|
||||||
|
|
||||||
|
..
|
||||||
|
|
||||||
|
jdalbec.c:65:5: error: stray '##' in program
|
||||||
|
65 | V F##B (B) ; \
|
||||||
|
| ^~
|
||||||
|
jdalbec.c:65:5: error: expected ';' before 'B'
|
||||||
|
65 | V F##B (B) ; \
|
||||||
|
| ^ ~
|
||||||
|
| ;
|
||||||
|
```
|
||||||
|
|
||||||
|
and various other problems.
|
||||||
|
|
||||||
|
|
||||||
## [2004/kopczynski](2004/kopczynski/kopczynski.c) ([README.md](2004/kopczynski/README.md]))
|
## [2004/kopczynski](2004/kopczynski/kopczynski.c) ([README.md](2004/kopczynski/README.md]))
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user