Mercurial > repo
changeset 8786:d4c599798de0
<fizzie> ` rm share/configure share/candide-to-conf # hopefully won\'t need these any more
author | HackBot |
---|---|
date | Sun, 10 Jul 2016 09:30:34 +0000 |
parents | d32a7c62d774 |
children | 543927904a61 |
files | share/candide-to-conf share/configure |
diffstat | 2 files changed, 0 insertions(+), 70 deletions(-) [+] |
line wrap: on
line diff
--- a/share/candide-to-conf Sun Jul 10 09:27:20 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/share/configure Sun Jul 10 09:27:20 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +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 <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