svn commit: branches/uClibc-nptl/include

sjhill at uclibc.org sjhill at uclibc.org
Fri Jan 6 03:19:16 UTC 2006


Author: sjhill
Date: 2006-01-05 19:19:14 -0800 (Thu, 05 Jan 2006)
New Revision: 13118

Log:
Move 'extend_alloca' so that it is usable by pthreads also.


Modified:
   branches/uClibc-nptl/include/libc-internal.h


Changeset:
Modified: branches/uClibc-nptl/include/libc-internal.h
===================================================================
--- branches/uClibc-nptl/include/libc-internal.h	2006-01-06 02:56:25 UTC (rev 13117)
+++ branches/uClibc-nptl/include/libc-internal.h	2006-01-06 03:19:14 UTC (rev 13118)
@@ -326,36 +326,6 @@
 #define fopen64 __fopen64
 #endif
 
-/* #include <alloca.h> */
-#include <bits/stackinfo.h>
-#if _STACK_GROWS_DOWN
-# define extend_alloca(buf, len, newlen) \
-  (__typeof (buf)) ({ size_t __newlen = (newlen);			      \
-		      char *__newbuf = alloca (__newlen);		      \
-		      if (__newbuf + __newlen == (char *) buf)		      \
-			len += __newlen;				      \
-		      else						      \
-			len = __newlen;					      \
-		      __newbuf; })
-#elif _STACK_GROWS_UP
-# define extend_alloca(buf, len, newlen) \
-  (__typeof (buf)) ({ size_t __newlen = (newlen);			      \
-		      char *__newbuf = alloca (__newlen);		      \
-		      char *__buf = (buf);				      \
-		      if (__buf + __newlen == __newbuf)			      \
-			{						      \
-			  len += __newlen;				      \
-			  __newbuf = __buf;				      \
-			}						      \
-		      else						      \
-			len = __newlen;					      \
-		      __newbuf; })
-#else
-# warning unknown stack
-# define extend_alloca(buf, len, newlen) \
-  alloca (((len) = (newlen)))
-#endif
-
 /* #include <stdlib.h> */
 extern char *__getenv (__const char *__name) attribute_hidden;
 extern void __exit (int __status) __THROW __attribute__ ((__noreturn__)) attribute_hidden;
@@ -478,6 +448,37 @@
 extern const char *__uclibc_progname attribute_hidden;
 
 # endif /* IS_IN_libc */
+
+/* #include <alloca.h> */
+#include <bits/stackinfo.h>
+#if _STACK_GROWS_DOWN
+# define extend_alloca(buf, len, newlen) \
+  (__typeof (buf)) ({ size_t __newlen = (newlen);			      \
+		      char *__newbuf = alloca (__newlen);		      \
+		      if (__newbuf + __newlen == (char *) buf)		      \
+			len += __newlen;				      \
+		      else						      \
+			len = __newlen;					      \
+		      __newbuf; })
+#elif _STACK_GROWS_UP
+# define extend_alloca(buf, len, newlen) \
+  (__typeof (buf)) ({ size_t __newlen = (newlen);			      \
+		      char *__newbuf = alloca (__newlen);		      \
+		      char *__buf = (buf);				      \
+		      if (__buf + __newlen == __newbuf)			      \
+			{						      \
+			  len += __newlen;				      \
+			  __newbuf = __buf;				      \
+			}						      \
+		      else						      \
+			len = __newlen;					      \
+		      __newbuf; })
+#else
+# warning unknown stack
+# define extend_alloca(buf, len, newlen) \
+  alloca (((len) = (newlen)))
+#endif
+
 #endif /* __ASSEMBLER__ */
 
 #endif /* _LIBC_INTERNAL_H */




More information about the uClibc-cvs mailing list