Re: [winebuild01] Add format printf attributes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dimitrie O. Paun wrote:
On September 18, 2003 07:37 am, Richard Cohen wrote:

+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)));


These are too GCC specific use something like __WINE_PRINTF_ATTR
from wine/debug.h

OK

diff -u -r tools/winebuild.0/build.h tools/winebuild.01/build.h
--- tools/winebuild.0/build.h	2003-09-18 12:26:10.000000000 +0100
+++ tools/winebuild.01/build.h	2003-09-18 15:06:25.000000000 +0100
@@ -126,14 +126,22 @@
 
 /* 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 -u -r tools/winebuild.0/res16.c tools/winebuild.01/res16.c
--- tools/winebuild.0/res16.c	2003-09-08 11:25:20.000000000 +0100
+++ tools/winebuild.01/res16.c	2003-09-18 12:17:32.000000000 +0100
@@ -173,7 +173,7 @@
 
     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 -u -r tools/winebuild.0/res32.c tools/winebuild.01/res32.c
--- tools/winebuild.0/res32.c	2003-09-08 11:25:20.000000000 +0100
+++ tools/winebuild.01/res32.c	2003-09-18 12:17:43.000000000 +0100
@@ -216,7 +216,7 @@
 
     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 */

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux