iOS/buildlibs/armv7/allegro-4.4.2/addons/allegrogl/src/win.c
/* Logs a Win32 error/warning message in the log file.
 */
Logs a Win32 error/warning message in the log file.
Logs a Win32 error / warning message in the log file .
static void log_win32_msg(const char *prefix, const char *func,
                          const char *error_msg, DWORD err) {
	char *err_msg = NULL;
	BOOL free_msg = TRUE;
	if (!FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER
		             | FORMAT_MESSAGE_FROM_SYSTEM
	                 | FORMAT_MESSAGE_IGNORE_INSERTS,
	                 NULL, err & 0x3FFF,
	                 MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
	                 (LPTSTR) &err_msg, 0, NULL)) {
		err_msg = "(Unable to decode error code)  ";
		free_msg = FALSE;
	}
	if (err_msg && strlen(err_msg) > 1)
		*(err_msg + strlen(err_msg) - 2) = '\0';
	TRACE("%s%s(): %s %s (0x%08lx)\n", prefix, func,
		  error_msg ? error_msg : "",
		  err_msg ? err_msg : "(null)",
		  (unsigned long)err);
	if (free_msg) {
		LocalFree(err_msg);
	}
	return;
}
static void log_win32_msg ( const char * prefix , const char * func , const char * error_msg , DWORD err ) { char * err_msg = NULL ; BOOL free_msg = TRUE ; if ( ! FormatMessage ( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS , NULL , err & 0x3FFF , MAKELANGID ( LANG_NEUTRAL , SUBLANG_DEFAULT ) , ( LPTSTR ) & err_msg , 0 , NULL ) ) { err_msg = " " ; free_msg = FALSE ; } if ( err_msg && strlen ( err_msg ) > 1 ) * ( err_msg + strlen ( err_msg ) - 2 ) = ' \0 ' ; TRACE ( " \n " , prefix , func , error_msg ? error_msg : " " , err_msg ? err_msg : " " , ( unsigned long ) err ) ; if ( free_msg ) { LocalFree ( err_msg ) ; } return ; }
Logs a Win32 error/warning message in the log file.
Logs a Win32 error / warning message in the log file .
/* Get the formatting error string from Windows. Note that only the
	 * bottom 14 bits matter - the rest are reserved for various library
	 * IDs and type of error.
	 */ /* Remove two trailing characters */