gcc 7 deprecates the use of varargs.h in favour of stdarg.h. mpfr already fixes it, but the fix is enabled if stdarg is available. This patch adds the test on CMakeLists.txt and enables the fix if needed.