Skip to content

Instantly share code, notes, and snippets.

@ixoo
ixoo / hello.cpp
Created February 14, 2012 19:53 — forked from L3n41c/.gitignore
Interpreted C++
#define XSTR(x) STR(x)
#define STR(x) #x
#line 6 XSTR(THIS_FILE)
#define BEGIN_SCRIPT /*
this_md5="$(md5sum < "$0" | cut -d' ' -f1)"
last_md5="$(readelf -p SOURCE_FILE_HASH "${0%.cpp}" 2>/dev/null | awk '/\[ *0\]/ { print $3 }')"
[ "$this_md5" != "$last_md5" ] && (
g++ -x c++ -std=c++0x -pipe -Wall -Wextra -g -O3 -DTHIS_FILE="$(basename $0)" -DTHIS_MD5="$this_md5" -o "${0%.cpp}" $0 ||
exit 1 )
exec "${0%.cpp}" "$@"