mirror of
				https://review.coreboot.org/flashrom.git
				synced 2025-10-31 05:10:41 +01:00 
			
		
		
		
	Fix compilation with older MinGW versions
The __MINGW_PRINTF_FORMAT constant has been defined back in 2012
77bc5d6103/
However older toolchains are still around and some user reported the
following compilation failure:
  flash.h:336:1: error: '__MINGW_PRINTF_FORMAT' is an unrecognized format function  type [-Werror=format=]
    __attribute__((format(__MINGW_PRINTF_FORMAT, 2, 3)));
Fix this by defining the constant when it isn't already; the change does
not affect other compilers because it's guarded by "#ifdef __MINGW32__".
Setting  __MINGW_PRINTF_FORMAT to gnu_printf is exactly what newer MinGW
versions do when __USE_MINGW_ANSI_STDIO is defined, which it is in
flashrom Makefile.
Change-Id: I48de3e4303b9a389c515a8ce230282d9210576fd
Tested-by: Miklos Marton <martonmiklosqdev@gmail.com>
Signed-off-by: Antonio Ospite <ao2@ao2.it>
Reviewed-on: https://review.coreboot.org/25130
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
			
			
This commit is contained in:
		 Antonio Ospite
					Antonio Ospite
				
			
				
					committed by
					
						 Nico Huber
						Nico Huber
					
				
			
			
				
	
			
			
			 Nico Huber
						Nico Huber
					
				
			
						parent
						
							22418428ed
						
					
				
				
					commit
					b6e3d257f9
				
			
							
								
								
									
										3
									
								
								flash.h
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								flash.h
									
									
									
									
									
								
							| @@ -360,6 +360,9 @@ int flashrom_print_cb(enum flashrom_log_level level, const char *fmt, va_list ap | |||||||
| /* Let gcc and clang check for correct printf-style format strings. */ | /* Let gcc and clang check for correct printf-style format strings. */ | ||||||
| int print(enum flashrom_log_level level, const char *fmt, ...) | int print(enum flashrom_log_level level, const char *fmt, ...) | ||||||
| #ifdef __MINGW32__ | #ifdef __MINGW32__ | ||||||
|  | #  ifndef __MINGW_PRINTF_FORMAT | ||||||
|  | #    define __MINGW_PRINTF_FORMAT gnu_printf | ||||||
|  | #  endif | ||||||
| __attribute__((format(__MINGW_PRINTF_FORMAT, 2, 3))); | __attribute__((format(__MINGW_PRINTF_FORMAT, 2, 3))); | ||||||
| #else | #else | ||||||
| __attribute__((format(printf, 2, 3))); | __attribute__((format(printf, 2, 3))); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user