Linux 3.13 compatibility for older GCC versions

This enables Linux 3.13 compatibility without depending on newer versions of GCC. It supersedes pull request #2135.