pkgsrc/games/gtkballs/patches/patch-ac
wiz fb858667fd Use G_GNUC_FUNCTION instead of __FUNCTION__, to fix build on Solaris.
From maintainer Sergey Svishchev in private mail.
Bump PKGREVISION.
2007-12-09 23:23:03 +00:00

56 lines
2.5 KiB
Text

$NetBSD: patch-ac,v 1.1 2007/12/09 23:23:03 wiz Exp $
--- src/themerc.c.orig 2002-11-14 14:06:33.000000000 +0000
+++ src/themerc.c
@@ -25,31 +25,31 @@ gchar **trc_open(gchar *fname) {
gchar *rc,**rcs;
if((fd=open(fname, O_RDONLY))==-1) {
- fprintf(stderr, "%s: open() %s failed: %s\n", __FUNCTION__, fname, strerror(errno));
+ fprintf(stderr, "%s: open() %s failed: %s\n", G_GNUC_FUNCTION, fname, strerror(errno));
return NULL;
}
if((fstat(fd, &fds))==-1) {
close(fd);
- fprintf(stderr, "%s: fstat() failed: %s\n", __FUNCTION__, strerror(errno));
+ fprintf(stderr, "%s: fstat() failed: %s\n", G_GNUC_FUNCTION, strerror(errno));
return NULL;
}
if(!(fds.st_size)) {
close(fd);
- fprintf(stderr, "%s: zero length file.\n", __FUNCTION__);
+ fprintf(stderr, "%s: zero length file.\n", G_GNUC_FUNCTION);
return NULL;
}
if(!(rc=malloc(fds.st_size+1))) {
close(fd);
- fprintf(stderr, "%s: malloc() failed: cannot alloc %d bytes\n", __FUNCTION__, (int)fds.st_size);
+ fprintf(stderr, "%s: malloc() failed: cannot alloc %d bytes\n", G_GNUC_FUNCTION, (int)fds.st_size);
return NULL;
}
if((rb=read(fd, rc, fds.st_size))!=fds.st_size) {
free(rc);
close(fd);
if(rb==-1) {
- fprintf(stderr, "%s: read() failed: %s\n", __FUNCTION__, strerror(errno));
+ fprintf(stderr, "%s: read() failed: %s\n", G_GNUC_FUNCTION, strerror(errno));
} else {
- fprintf(stderr, "%s: read() reads less bytes than expected =/\n", __FUNCTION__);
+ fprintf(stderr, "%s: read() reads less bytes than expected =/\n", G_GNUC_FUNCTION);
}
return NULL;
}
@@ -73,11 +73,11 @@ gchar *trc_get_str(gchar **rcs, gchar *p
gchar **strval,*val;
if(!rcs) {
- fprintf(stderr, "%s called with uninitialised rcs. strange. \n", __FUNCTION__);
+ fprintf(stderr, "%s called with uninitialised rcs. strange. \n", G_GNUC_FUNCTION);
return NULL;
}
if(!param) {
- fprintf(stderr, "%s called with NULL param. strange. \n", __FUNCTION__);
+ fprintf(stderr, "%s called with NULL param. strange. \n", G_GNUC_FUNCTION);
return NULL;
}
for(i=0;rcs[i];i++) {