Fix YAML/TinyXML patches for GCC versions older than 4.2

Make addition of -fvisibility-inlines-hidden dependent on GCC version.