[coreboot] [v2] r4441 - trunk/coreboot-v2/src/include

svn at coreboot.org svn at coreboot.org
Sun Jul 19 02:18:15 CEST 2009


Author: stepan
Date: 2009-07-19 02:18:15 +0200 (Sun, 19 Jul 2009)
New Revision: 4441

Modified:
   trunk/coreboot-v2/src/include/string.h
Log:
The file string.h is also included in romcc code, which has no malloc().
The patch adds proper preprocessor guards and drops the malloc() prototype
because that's in stdlib.h

Signed-off-by: Stefan Reinauer <stepan at coresystems.de>
Acked-by: Stefan Reinauer <stepan at coresystems.de>



Modified: trunk/coreboot-v2/src/include/string.h
===================================================================
--- trunk/coreboot-v2/src/include/string.h	2009-07-18 18:00:37 UTC (rev 4440)
+++ trunk/coreboot-v2/src/include/string.h	2009-07-19 00:18:15 UTC (rev 4441)
@@ -8,7 +8,6 @@
 void *memmove(void *dest, const void *src, size_t n);
 void *memset(void *s, int c, size_t n);
 int memcmp(const void *s1, const void *s2, size_t n);
-void *malloc(size_t size);
 int sprintf(char * buf, const char *fmt, ...);
 
 // yes, linux has fancy ones. We don't care. This stuff gets used 
@@ -45,6 +44,7 @@
 	return 0;
 }
 
+#ifndef __ROMCC__
 static inline char *strdup(const char *s)
 {   
 	size_t sz = strlen(s) + 1;
@@ -52,6 +52,7 @@
 	memcpy(d, s, sz);
 	return d;
 }
+#endif
 
 static inline char *strncpy(char *to, const char *from, int count)
 {





More information about the coreboot mailing list