Detect _snprintf.
Fix handling of HAVE_* variables.