Adjusted alternate version to preserve formatting

The first alt version added some whitespaces that broke the outline, so
I simply filled those up.  I also expanded tabs to spaces since there is
no size limit restriction for the alternate version.

The second alt version attempted to force binary mode with _setmode()
and _fileno() calls, plus some additional headers.  Rather than doing it
this way, I hack in the binary mode adjustments via preprocessor.

Actually I did a similar trick for IOCCC 2011, but I guess I didn't
submit that version:
https://uguu.org/archive/ioccc2011/akari/source/binmode_main.h

The file above uses _setmode() and _fileno().  The leading underscore
indicates that they were nonstandard extensions.  For the binmode_main.h
in this change, I have opted for setmode() and STDIN_FILENO instead,
which are more widely available.
This commit is contained in:
omoikane committed 2025-05-15 17:51:12 -07:00
1 parent 376f51c489
commit aff78be8f9
5 files changed
+93 -117

No files matched your search

+2 -11
View File
@@ -62,7 +62,7 @@ CDEFINE=
# Include files that are needed to compile
#
CINCLUDE=
CINCLUDE=-include binmode_main.h
# Optimization
#
@@ -146,15 +146,6 @@ ${PROG}.alt: ${PROG}.alt.c
${PROG}.alt.c: ${ENTRY}.alt.c
${CP} -f -v $? $@
alt2: data ${ALT_TARGET}2
@${TRUE}
${PROG}.alt2: ${PROG}.alt2.c
${CC} ${CFLAGS} $< -o $@ ${LDFLAGS}
${PROG}.alt2.c: ${ENTRY}.alt2.c
${CP} -f -v $? $@
# data files
#
data: ${DATA}
@@ -175,7 +166,7 @@ clean:
clobber: clean
${RM} -f ${TARGET} ${ALT_TARGET}
${RM} -f ${PROG}.c ${PROG}.alt.c ${PROG}.alt2.c
${RM} -f ${PROG}.c ${PROG}.alt.c
${RM} -rf *.dSYM
${RM} -f output.c key.c data.c regenerated.bin data output output.2