Mercurial > repo
changeset 8779:5f52ffcf08be
<fizzie> ` mv configure candide-to-conf share/
author | HackBot |
---|---|
date | Sun, 10 Jul 2016 08:57:53 +0000 |
parents | abfbcd1a21d5 |
children | 2eddfbfc5c40 |
files | candide-to-conf configure share/candide-to-conf share/configure |
diffstat | 4 files changed, 71 insertions(+), 71 deletions(-) [+] |
line wrap: on
line diff
--- a/candide-to-conf Sun Jul 10 08:43:01 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -#!/bin/bash -# compile c from stdin -# candide, kinda - -readinput () { - while read -r -e || { printf %s "$REPLY"; false; } ; do - printf '%s\n' "$REPLY" - done -} - -c=$(readinput) -if ! [[ $c ]] || ! out=$(mktemp); then - echo Error >&2 - exit 1 -fi - -# if you don't write 'main' it assumes that you're writing a full program (with free includes) -# this allows you to use other functions and stuff -# it will get false positives, but who cares? -if [[ $c != *main* ]]; then c=$(cat <<SOURCE -int main(int argc, char *argv[]) { -$c - return 0; -} -SOURCE -); fi - -# will replace -O0 with the parameters -gcc -o "$out" -x c -I %%DIRECTORY%% "${@--O0}" /dev/fd/0 <<SOURCE && { "$out" && { rm -f "$out"; true; }; } -#include "headers" /* precompiled headers */ -$c -SOURCE
--- a/configure Sun Jul 10 08:43:01 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -#!/bin/bash -gcc -o headers.gch -x c-header -c /dev/fd/0 <<SOURCE -#define _XOPEN_SOURCE 9001 -#define __USE_XOPEN -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <unistd.h> -#include <math.h> -#include <limits.h> -#include <sys/types.h> -#include <stdint.h> -#include <stdbool.h> -#include <stddef.h> -#include <stdarg.h> -#include <stdnoreturn.h> -#include <stdalign.h> -#include <ctype.h> -#include <inttypes.h> -#include <float.h> -#include <errno.h> -#include <time.h> -#include <assert.h> -#include <complex.h> -#include <setjmp.h> -#include <wchar.h> -#include <wctype.h> -#include <tgmath.h> -#include <fenv.h> -#include <locale.h> -#include <iso646.h> -#include <signal.h> -#include <uchar.h> -#include <unistd.h> -#include <fcntl.h> -SOURCE -# if you have pipes in your directory, you're evil -sed "s|%%DIRECTORY%%|$PWD|g" candide-to-conf > candide -chmod +x candide
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/share/candide-to-conf Sun Jul 10 08:57:53 2016 +0000 @@ -0,0 +1,32 @@ +#!/bin/bash +# compile c from stdin +# candide, kinda + +readinput () { + while read -r -e || { printf %s "$REPLY"; false; } ; do + printf '%s\n' "$REPLY" + done +} + +c=$(readinput) +if ! [[ $c ]] || ! out=$(mktemp); then + echo Error >&2 + exit 1 +fi + +# if you don't write 'main' it assumes that you're writing a full program (with free includes) +# this allows you to use other functions and stuff +# it will get false positives, but who cares? +if [[ $c != *main* ]]; then c=$(cat <<SOURCE +int main(int argc, char *argv[]) { +$c + return 0; +} +SOURCE +); fi + +# will replace -O0 with the parameters +gcc -o "$out" -x c -I %%DIRECTORY%% "${@--O0}" /dev/fd/0 <<SOURCE && { "$out" && { rm -f "$out"; true; }; } +#include "headers" /* precompiled headers */ +$c +SOURCE
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/share/configure Sun Jul 10 08:57:53 2016 +0000 @@ -0,0 +1,39 @@ +#!/bin/bash +gcc -o headers.gch -x c-header -c /dev/fd/0 <<SOURCE +#define _XOPEN_SOURCE 9001 +#define __USE_XOPEN +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> +#include <math.h> +#include <limits.h> +#include <sys/types.h> +#include <stdint.h> +#include <stdbool.h> +#include <stddef.h> +#include <stdarg.h> +#include <stdnoreturn.h> +#include <stdalign.h> +#include <ctype.h> +#include <inttypes.h> +#include <float.h> +#include <errno.h> +#include <time.h> +#include <assert.h> +#include <complex.h> +#include <setjmp.h> +#include <wchar.h> +#include <wctype.h> +#include <tgmath.h> +#include <fenv.h> +#include <locale.h> +#include <iso646.h> +#include <signal.h> +#include <uchar.h> +#include <unistd.h> +#include <fcntl.h> +SOURCE +# if you have pipes in your directory, you're evil +sed "s|%%DIRECTORY%%|$PWD|g" candide-to-conf > candide +chmod +x candide