gcc 4.6 and clang 3.3 support

As the original author appears to be inactive, and I want to make pull request to somewhere, I send it to you ;)

Tests can't be compiled on gcc 4.6, so this support is not ideal... But still something (that seems to work btw, as I'm using it in some other projects) is better than nothing.