Mercurial > repo
changeset 9083:00300a2789b3
<oerjan> rm candide
author | HackBot |
---|---|
date | Mon, 26 Sep 2016 08:19:40 +0000 |
parents | c09a4c1bf558 |
children | 132542b8bf63 |
files | candide |
diffstat | 1 files changed, 0 insertions(+), 32 deletions(-) [+] |
line wrap: on
line diff
--- a/candide Mon Sep 26 08:10:11 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 /hackenv "${@--O0}" /dev/fd/0 <<SOURCE && { "$out" && { rm -f "$out"; true; }; } -#include "headers" /* precompiled headers */ -$c -SOURCE