This is not the right way to conditionally apply patch. Also it looks like this patch is not optional if built with -DTIXML_USE_STL.