Fixed cast of incompatible function pointer,

Default logger must return 'void', not 'int'
This commit is contained in:
Evgeny Grin (Karlson2k)
2019-05-25 16:29:54 +03:00
parent 6d210e7986
commit 29e20dfb65
2 changed files with 15 additions and 2 deletions
+14 -1
View File
@@ -218,6 +218,19 @@ MHD_check_global_init_ (void)
}
#endif /* ! _AUTOINIT_FUNCS_ARE_SUPPORTED */
/**
* Default logger function
*/
static void
MHD_default_logger_ (void *cls,
const char *fm,
va_list ap)
{
vfprintf ((FILE*)cls, fm, ap);
}
/**
* Trace up to and return master daemon. If the supplied daemon
* is a master, then return the daemon itself.
@@ -5664,7 +5677,7 @@ MHD_start_daemon_va (unsigned int flags,
daemon->listen_backlog_size = 511; /* should be safe value */
#endif /* !SOMAXCONN */
#ifdef HAVE_MESSAGES
daemon->custom_error_log = (MHD_LogCallback) &vfprintf;
daemon->custom_error_log = &MHD_default_logger_;
daemon->custom_error_log_cls = stderr;
#endif
if ( (0 != (*pflags & MHD_USE_THREAD_PER_CONNECTION)) &&
+1 -1
View File
@@ -1422,7 +1422,7 @@ struct MHD_Daemon
* Function for logging error messages (if we
* support error reporting).
*/
void (*custom_error_log) (void *cls, const char *fmt, va_list va);
MHD_LogCallback custom_error_log;
/**
* Closure argument to @e custom_error_log.