Hi,

After getting some linking errors using rand() and srand(), I found that
stdlib.h does not check if the compiler is a C++ compiler.

This patch fixes it.

diff -u -r msp430-libc-20110612-old//include/stdlib.h
msp430-libc-20110612/include/stdlib.h
--- msp430-libc-20110612-old//include/stdlib.h 2011-08-22 20:59:16.087783008
+0200
+++ msp430-libc-20110612/include/stdlib.h 2011-08-22 21:00:02.227783034
+0200
@@ -32,6 +32,10 @@
 #include <stddef.h>
 #include <sys/types.h>

+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #if !defined(__ATTR_CONST__)
 #define __ATTR_CONST__ __attribute__((__const__))
 #endif
@@ -106,4 +110,8 @@
 void srand(unsigned __seed);
 int rand_r(unsigned *__seed);

+#ifdef __cplusplus
+}
+#endif
+
 #endif


Regards
Jacques
------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users

Reply via email to