From 94f33ff7e3b7140e78c014be1a68fe9c1ba17814 Mon Sep 17 00:00:00 2001 From: Juergen Keil Date: Thu, 6 Sep 2001 18:38:11 +0000 Subject: Trying to port the xine-lib sources to a non-gcc compiler CVS patchset: 584 CVS date: 2001/09/06 18:38:11 --- src/xine-engine/utils.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/xine-engine/utils.c') diff --git a/src/xine-engine/utils.c b/src/xine-engine/utils.c index 3f45e909c..5a9dc5573 100644 --- a/src/xine-engine/utils.c +++ b/src/xine-engine/utils.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: utils.c,v 1.3 2001/09/06 13:29:18 jkeil Exp $ + * $Id: utils.c,v 1.4 2001/09/06 18:38:12 jkeil Exp $ * */ #define _POSIX_PTHREAD_SEMANTICS 1 /* for 5-arg getpwuid_r on solaris */ @@ -35,25 +35,26 @@ #include #include +#ifndef __GNUC__ +#define __FUNCTION__ __func__ +#endif + + /* * */ void *xmalloc(size_t size) { - void *ptrmalloc, *ptrmemset; + void *ptr; - if((ptrmalloc = malloc(size)) == NULL) { + if((ptr = malloc(size)) == NULL) { fprintf(stderr, "%s: malloc() failed: %s.\n", __FUNCTION__, strerror(errno)); return NULL; } - if((ptrmemset = memset(ptrmalloc, 0, size)) == NULL) { - fprintf(stderr, "%s: memset() failed: %s.\n", - __FUNCTION__, strerror(errno)); - return NULL; - } + memset(ptr, 0, size); - return ptrmemset; + return ptr; } /* -- cgit v1.2.3