From 5bcf35a38535e782234f0db107ff97c6af65245d Mon Sep 17 00:00:00 2001 From: Richard Cohen Date: Fri, 19 Sep 2003 00:19:16 +0000 Subject: [PATCH] Add printf format attributes & fix the warnings. --- tools/winebuild/build.h | 16 ++++++++++++---- tools/winebuild/res16.c | 2 +- tools/winebuild/res32.c | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/tools/winebuild/build.h b/tools/winebuild/build.h index 92f11beb6bf..1d12695742b 100644 --- a/tools/winebuild/build.h +++ b/tools/winebuild/build.h @@ -126,14 +126,22 @@ typedef struct /* global functions */ +#ifndef __GNUC__ +#define __attribute__(X) +#endif + extern void *xmalloc (size_t size); extern void *xrealloc (void *ptr, size_t size); extern char *xstrdup( const char *str ); extern char *strupper(char *s); -extern void fatal_error( const char *msg, ... ); -extern void fatal_perror( const char *msg, ... ); -extern void error( const char *msg, ... ); -extern void warning( const char *msg, ... ); +extern void fatal_error( const char *msg, ... ) + __attribute__ ((__format__ (__printf__, 1, 2))); +extern void fatal_perror( const char *msg, ... ) + __attribute__ ((__format__ (__printf__, 1, 2))); +extern void error( const char *msg, ... ) + __attribute__ ((__format__ (__printf__, 1, 2))); +extern void warning( const char *msg, ... ) + __attribute__ ((__format__ (__printf__, 1, 2))); extern void output_standard_file_header( FILE *outfile ); extern FILE *open_input_file( const char *srcdir, const char *name ); extern void close_input_file( FILE *file ); diff --git a/tools/winebuild/res16.c b/tools/winebuild/res16.c index f917baa0b50..bd018397180 100644 --- a/tools/winebuild/res16.c +++ b/tools/winebuild/res16.c @@ -173,7 +173,7 @@ void load_res16_file( const char *name ) if ((fd = open( name, O_RDONLY )) == -1) fatal_perror( "Cannot open %s", name ); if ((fstat( fd, &st ) == -1)) fatal_perror( "Cannot stat %s", name ); - if (!st.st_size) fatal_error( "%s is an empty file\n" ); + if (!st.st_size) fatal_error( "%s is an empty file\n", name ); #ifdef HAVE_MMAP if ((base = mmap( NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0 )) == (void*)-1) #endif /* HAVE_MMAP */ diff --git a/tools/winebuild/res32.c b/tools/winebuild/res32.c index 071a76422d4..73a1f92fc78 100644 --- a/tools/winebuild/res32.c +++ b/tools/winebuild/res32.c @@ -216,7 +216,7 @@ int load_res32_file( const char *name ) if ((fd = open( name, O_RDONLY )) == -1) fatal_perror( "Cannot open %s", name ); if ((fstat( fd, &st ) == -1)) fatal_perror( "Cannot stat %s", name ); - if (!st.st_size) fatal_error( "%s is an empty file\n" ); + if (!st.st_size) fatal_error( "%s is an empty file\n", name ); #ifdef HAVE_MMAP if ((base = mmap( NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0 )) == (void*)-1) #endif /* HAVE_MMAP */ -- 2.11.4.GIT