complete port to GCC 4.6