Merge pull request #878 from xexyl/2015-endoh3
Fix 2015/endoh3 for linux
This commit is contained in:
19 files changed
+117
-75
No files matched your search
+1
-1
@@ -127,7 +127,7 @@ all: data ${TARGET}
|
|||||||
supernova deep_magic magic charon pluto
|
supernova deep_magic magic charon pluto
|
||||||
|
|
||||||
${PROG}: ${PROG}.c
|
${PROG}: ${PROG}.c
|
||||||
@echo "source stig.sh ; source stig.c" | ${SH}
|
@echo "source ./stig.sh ; source ./stig.c" | ${SH}
|
||||||
|
|
||||||
# alternative executable
|
# alternative executable
|
||||||
#
|
#
|
||||||
|
|||||||
+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;
|
||||||
}
|
}
|
||||||
+1
-1
@@ -73,7 +73,7 @@ CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT}
|
|||||||
|
|
||||||
# Libraries needed to build
|
# Libraries needed to build
|
||||||
#
|
#
|
||||||
LIBS= `${SDL2_CONFIG} --libs`
|
LIBS= `${SDL2_CONFIG} --libs` -lm
|
||||||
|
|
||||||
# C compiler to use
|
# C compiler to use
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT}
|
|||||||
|
|
||||||
# Libraries needed to build
|
# Libraries needed to build
|
||||||
#
|
#
|
||||||
LIBS=
|
LIBS= -lm
|
||||||
|
|
||||||
# C compiler to use
|
# C compiler to use
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT}
|
|||||||
|
|
||||||
# Libraries needed to build
|
# Libraries needed to build
|
||||||
#
|
#
|
||||||
LIBS=
|
LIBS= -lm
|
||||||
|
|
||||||
# C compiler to use
|
# C compiler to use
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -1,8 +1,3 @@
|
|||||||
grothe
|
grothe
|
||||||
grothe.c.1
|
grothe.c.1
|
||||||
grothe.c.2
|
grothe.c.2
|
||||||
cookie_recipe_restore.txt
|
|
||||||
cookie_piece1.dat
|
|
||||||
cookie_piece2.dat
|
|
||||||
cookie_piece3.dat
|
|
||||||
cookie_piece4.dat
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -73,7 +73,7 @@ CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT}
|
|||||||
|
|
||||||
# Libraries needed to build
|
# Libraries needed to build
|
||||||
#
|
#
|
||||||
LIBS= -L ${X11_LIBDIR} -lX11
|
LIBS= -L ${X11_LIBDIR} -lX11 -lm
|
||||||
|
|
||||||
# C compiler to use
|
# C compiler to use
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ ARCH=
|
|||||||
|
|
||||||
# Defines that are needed to compile
|
# Defines that are needed to compile
|
||||||
#
|
#
|
||||||
CDEFINE=
|
CDEFINE= -fcommon
|
||||||
|
|
||||||
# Include files that are needed to compile
|
# Include files that are needed to compile
|
||||||
#
|
#
|
||||||
|
|||||||
+1
-1
@@ -73,7 +73,7 @@ CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT}
|
|||||||
|
|
||||||
# Libraries needed to build
|
# Libraries needed to build
|
||||||
#
|
#
|
||||||
LIBS=
|
LIBS= -lm
|
||||||
|
|
||||||
# C compiler to use
|
# C compiler to use
|
||||||
#
|
#
|
||||||
|
|||||||
+1
-1
@@ -74,7 +74,7 @@ CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT}
|
|||||||
|
|
||||||
# Libraries needed to build
|
# Libraries needed to build
|
||||||
#
|
#
|
||||||
LIBS=
|
LIBS= -lm
|
||||||
|
|
||||||
# C compiler to use
|
# C compiler to use
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT}
|
|||||||
|
|
||||||
# Libraries needed to build
|
# Libraries needed to build
|
||||||
#
|
#
|
||||||
LIBS= -lcurses
|
LIBS= -lcurses -lm
|
||||||
|
|
||||||
# C compiler to use
|
# C compiler to use
|
||||||
#
|
#
|
||||||
|
|||||||
+1
-1
@@ -73,7 +73,7 @@ CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT}
|
|||||||
|
|
||||||
# Libraries needed to build
|
# Libraries needed to build
|
||||||
#
|
#
|
||||||
LIBS=
|
LIBS= -lm
|
||||||
|
|
||||||
# C compiler to use
|
# C compiler to use
|
||||||
#
|
#
|
||||||
|
|||||||
+1
-1
@@ -76,7 +76,7 @@ CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT}
|
|||||||
|
|
||||||
# Libraries needed to build
|
# Libraries needed to build
|
||||||
#
|
#
|
||||||
LIBS= -L ${X11_LIBDIR} -lX11
|
LIBS= -L ${X11_LIBDIR} -lX11 -lm
|
||||||
|
|
||||||
# C compiler to use
|
# C compiler to use
|
||||||
#
|
#
|
||||||
|
|||||||
+81
-3
@@ -426,6 +426,11 @@ Yusuke pointed out that `atof` nowadays needs `#include <stdlib.h>` which was
|
|||||||
used in order to get this to work initially (prior to this output was there but
|
used in order to get this to work initially (prior to this output was there but
|
||||||
incomplete).
|
incomplete).
|
||||||
|
|
||||||
|
## [1990/stig](1990/stig/stig.c) ([README.md](1990/stig/README.md))
|
||||||
|
|
||||||
|
Cody fixed the paths in the Makefile so that this would build in linux (it
|
||||||
|
worked fine in macOS).
|
||||||
|
|
||||||
|
|
||||||
## [1990/westley](1990/westley/westley.c) ([README.md](1990/westley/README.md]))
|
## [1990/westley](1990/westley/westley.c) ([README.md](1990/westley/README.md]))
|
||||||
|
|
||||||
@@ -1001,6 +1006,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]))
|
||||||
|
|
||||||
@@ -1129,12 +1160,17 @@ for the self-test feature.
|
|||||||
|
|
||||||
For much more details on the problem see [bugs.md](/bugs.md).
|
For much more details on the problem see [bugs.md](/bugs.md).
|
||||||
|
|
||||||
|
## [2005/jetro](2005/jetro/jetro.c) ([README.md](2005/jetro/README.md))
|
||||||
|
|
||||||
|
Cody added explicit linking of libm (`-lm`) for systems like linux that seem to
|
||||||
|
not do it implicitly (like macOS does).
|
||||||
|
|
||||||
|
|
||||||
## [2005/mynx](2005/mynx/mynx.c) ([README.md](2005/mynx/README.md]))
|
## [2005/mynx](2005/mynx/mynx.c) ([README.md](2005/mynx/README.md]))
|
||||||
|
|
||||||
Cody fixed this so that the
|
Cody fixed this so that the [configure](source/configure) script (which is not
|
||||||
[configure](source/configure) script (which is not needed but part of the entry)
|
needed but part of the entry) would work with compilers that have by default
|
||||||
would work with compilers that have by default `-Werror` like clang in macOS.
|
`-Werror` like clang in macOS.
|
||||||
|
|
||||||
Cody also added the alt code which does scan for https. Futile, maybe, based on
|
Cody also added the alt code which does scan for https. Futile, maybe, based on
|
||||||
how https is set up, in which case just enjoy it for what it was. But there
|
how https is set up, in which case just enjoy it for what it was. But there
|
||||||
@@ -1225,6 +1261,16 @@ Cody, though he feels slightly sick :-), added a version for Windows based on
|
|||||||
the author's comments (along with looking up the function for the right header
|
the author's comments (along with looking up the function for the right header
|
||||||
file). To build try the alt rule of the Makefile.
|
file). To build try the alt rule of the Makefile.
|
||||||
|
|
||||||
|
## [2012/blakely](2012/blakely/blakely.c) ([README.md](2012/blakely/README.md))
|
||||||
|
|
||||||
|
Cody added explicit linking of libm (`-lm`) as not all systems do this
|
||||||
|
implicitly (linux doesn't seem to but macOS does).
|
||||||
|
|
||||||
|
## [2012/endoh1](2012/endoh1/endoh1.c) ([README.md](2012/endoh1/README.md))
|
||||||
|
|
||||||
|
Cody added explicit linking of libm (`-lm`) as not all systems do this
|
||||||
|
implicitly (linux doesn't seem to but macOS does).
|
||||||
|
|
||||||
|
|
||||||
## [2012/kang](2012/kang/kang.c) ([README.md](2012/kang/README.md]))
|
## [2012/kang](2012/kang/kang.c) ([README.md](2012/kang/README.md]))
|
||||||
|
|
||||||
@@ -1263,6 +1309,11 @@ removed from SDL2 so the Makefile has to use `sdl-config` and not `sdl2-config`.
|
|||||||
This means that to be strictly technical, the removal of `localtime()` is not
|
This means that to be strictly technical, the removal of `localtime()` is not
|
||||||
necessary but this change was left in place anyway.
|
necessary but this change was left in place anyway.
|
||||||
|
|
||||||
|
## [2013/morgan1](2013/morgan1/morgan1.c) ([README.md](2013/morgan1/README.md))
|
||||||
|
|
||||||
|
Cody added explicit linking of libm (`-lm`) as not all systems do this
|
||||||
|
implicitly (linux doesn't seem to but macOS does).
|
||||||
|
|
||||||
|
|
||||||
## [2014/maffiodo1](2014/maffiodo1/maffiodo1.c) ([README.md](2014/maffiodo1/README.md]))
|
## [2014/maffiodo1](2014/maffiodo1/maffiodo1.c) ([README.md](2014/maffiodo1/README.md]))
|
||||||
|
|
||||||
@@ -1272,6 +1323,10 @@ were linking errors.
|
|||||||
|
|
||||||
## [2015/endoh3](2015/endoh3/prog.c) ([README.md](2015/endoh3/README.md]))
|
## [2015/endoh3](2015/endoh3/prog.c) ([README.md](2015/endoh3/README.md]))
|
||||||
|
|
||||||
|
Cody fixed this to compile with linux which was having a problem with duplicate
|
||||||
|
symbols of `main()`. The fix is through the option `-fcommon` which will let it
|
||||||
|
compile like it does with macOS.
|
||||||
|
|
||||||
The author, Yusuke, supplied the additional source files, which Cody added to
|
The author, Yusuke, supplied the additional source files, which Cody added to
|
||||||
the repo for us. Yusuke wrote in his [analysis of the
|
the repo for us. Yusuke wrote in his [analysis of the
|
||||||
entry](https://mame-github-io.translate.goog/ioccc-ja-spoilers/2015/endoh3.html?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp)
|
entry](https://mame-github-io.translate.goog/ioccc-ja-spoilers/2015/endoh3.html?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp)
|
||||||
@@ -1279,12 +1334,30 @@ that there are others as well but we don't seem to have them and he didn't
|
|||||||
provide them on his page. We've not yet contacted him for a copy but we will in
|
provide them on his page. We've not yet contacted him for a copy but we will in
|
||||||
time.
|
time.
|
||||||
|
|
||||||
|
## [2015/hou](2015/hou/prog.c) ([README.md](2015/hou/README.md))
|
||||||
|
|
||||||
|
Cody added explicit linking of libm (`-lm`) for systems that do not do this
|
||||||
|
(linux doesn't seem to but macOS does).
|
||||||
|
|
||||||
|
|
||||||
## [2015/yang](2015/yang/prog.c) ([README.md](2015/yang/README.md]))
|
## [2015/yang](2015/yang/prog.c) ([README.md](2015/yang/README.md]))
|
||||||
|
|
||||||
Cody fixed an unfortunate typo in the Makefile that was preventing some of the
|
Cody fixed an unfortunate typo in the Makefile that was preventing some of the
|
||||||
files from compiling properly, trying instead to compile already compiled code.
|
files from compiling properly, trying instead to compile already compiled code.
|
||||||
|
|
||||||
|
He also added explicit linking of libm (`-lm`) for systems that do not do this
|
||||||
|
(linux seems to not but macOS does).
|
||||||
|
|
||||||
|
## [2018/bellard](2018/bellard/prog.c) ([README.md](2018/bellard/README.md))
|
||||||
|
|
||||||
|
Cody added explicit linking of libm (`-lm`) for systems that do not do this
|
||||||
|
(linux doesn't seem to but macOS does).
|
||||||
|
|
||||||
|
## [2018/hou](2018/hou/prog.c) ([README.md](2018/hou/README.md))
|
||||||
|
|
||||||
|
Cody added explicit linking of libm (`-lm`) for systems that do not do this
|
||||||
|
(linux doesn't seem to but macOS does).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [2019/ciura](2019/ciura/prog.c) ([README.md](2019/ciura/README.md]))
|
## [2019/ciura](2019/ciura/prog.c) ([README.md](2019/ciura/README.md]))
|
||||||
@@ -1310,6 +1383,11 @@ Cody made the author's statement that the entry compiles cleanly true by fixing
|
|||||||
versions of C` (in main()). Not strictly necessary but if he's making fixes he
|
versions of C` (in main()). Not strictly necessary but if he's making fixes he
|
||||||
might as well.
|
might as well.
|
||||||
|
|
||||||
|
## [2019/dogon](2019/dogon/prog.c) ([README.md](2019/dogon/README.md))
|
||||||
|
|
||||||
|
Cody added explicit linking of libm (`-lm`) for systems that do not do this
|
||||||
|
(linux does not seem to but macOS does).
|
||||||
|
|
||||||
|
|
||||||
## [2019/karns](2019/karns/prog.c) ([README.md](2019/karns/README.md]))
|
## [2019/karns](2019/karns/prog.c) ([README.md](2019/karns/README.md]))
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user