svn commit: trunk/uClibc: include libpthread/linuxthreads/sysdeps/ etc...

carmelo at uclibc.org carmelo at uclibc.org
Thu Sep 25 06:38:21 UTC 2008


Author: carmelo
Date: 2008-09-24 23:38:21 -0700 (Wed, 24 Sep 2008)
New Revision: 23478

Log:
Add globally __stringify macro in libc-symbols.h.
Remove all other duplicated definitions.

Signed-off-by: Carmelo Amoroso <carmelo.amoroso at st.com>


Modified:
   trunk/uClibc/include/libc-symbols.h
   trunk/uClibc/libpthread/linuxthreads.old/internals.h
   trunk/uClibc/libpthread/linuxthreads/sysdeps/pthread/uClibc-glue.h
   trunk/uClibc/test/unistd/tst-preadwrite.c


Changeset:
Modified: trunk/uClibc/include/libc-symbols.h
===================================================================
--- trunk/uClibc/include/libc-symbols.h	2008-09-25 06:13:24 UTC (rev 23477)
+++ trunk/uClibc/include/libc-symbols.h	2008-09-25 06:38:21 UTC (rev 23478)
@@ -82,6 +82,12 @@
 # define IS_IN_libc 1
 #endif
 
+/* Indirect stringification.  Doing two levels allows
+ * the parameter to be a macro itself.
+ */
+#define __stringify_1(x)    #x
+#define __stringify(x)      __stringify_1(x)
+
 #ifdef __UCLIBC_HAVE_ASM_SET_DIRECTIVE__
 # define HAVE_ASM_SET_DIRECTIVE
 #else

Modified: trunk/uClibc/libpthread/linuxthreads/sysdeps/pthread/uClibc-glue.h
===================================================================
--- trunk/uClibc/libpthread/linuxthreads/sysdeps/pthread/uClibc-glue.h	2008-09-25 06:13:24 UTC (rev 23477)
+++ trunk/uClibc/libpthread/linuxthreads/sysdeps/pthread/uClibc-glue.h	2008-09-25 06:38:21 UTC (rev 23478)
@@ -42,8 +42,6 @@
 
 /* Use a funky version in a probably vein attempt at preventing gdb
  * from dlopen()'ing glibc's libthread_db library... */
-#define STRINGIFY(s) STRINGIFY2 (s)
-#define STRINGIFY2(s) #s
-#define VERSION STRINGIFY(__UCLIBC_MAJOR__) "." STRINGIFY(__UCLIBC_MINOR__) "." STRINGIFY(__UCLIBC_SUBLEVEL__)
+#define VERSION __stringify(__UCLIBC_MAJOR__) "." __stringify(__UCLIBC_MINOR__) "." __stringify(__UCLIBC_SUBLEVEL__)
 
 #endif

Modified: trunk/uClibc/libpthread/linuxthreads.old/internals.h
===================================================================
--- trunk/uClibc/libpthread/linuxthreads.old/internals.h	2008-09-25 06:13:24 UTC (rev 23477)
+++ trunk/uClibc/libpthread/linuxthreads.old/internals.h	2008-09-25 06:38:21 UTC (rev 23478)
@@ -36,9 +36,7 @@
 
 /* Use a funky version in a probably vein attempt at preventing gdb
  * from dlopen()'ing glibc's libthread_db library... */
-#define STRINGIFY(s) STRINGIFY2 (s)
-#define STRINGIFY2(s) #s
-#define VERSION STRINGIFY(__UCLIBC_MAJOR__) "." STRINGIFY(__UCLIBC_MINOR__) "." STRINGIFY(__UCLIBC_SUBLEVEL__)
+#define VERSION __stringify(__UCLIBC_MAJOR__) "." __stringify(__UCLIBC_MINOR__) "." __stringify(__UCLIBC_SUBLEVEL__)
 
 #ifndef THREAD_GETMEM
 # define THREAD_GETMEM(descr, member) descr->member

Modified: trunk/uClibc/test/unistd/tst-preadwrite.c
===================================================================
--- trunk/uClibc/test/unistd/tst-preadwrite.c	2008-09-25 06:13:24 UTC (rev 23477)
+++ trunk/uClibc/test/unistd/tst-preadwrite.c	2008-09-25 06:38:21 UTC (rev 23478)
@@ -30,9 +30,6 @@
 # define PWRITE pwrite
 #endif
 
-#define STRINGIFY(s) STRINGIFY2 (s)
-#define STRINGIFY2(s) #s
-
 /* Prototype for our test function.  */
 extern void do_prepare (int argc, char *argv[]);
 extern int do_test (int argc, char *argv[]);
@@ -56,7 +53,7 @@
    char name_len;
 
 #define FNAME FNAME2(TRUNCATE)
-#define FNAME2(s) "/" STRINGIFY(s) "XXXXXX"
+#define FNAME2(s) "/" __stringify(s) "XXXXXX"
 
    name_len = strlen (test_dir);
    name = malloc (name_len + sizeof (FNAME));
@@ -88,15 +85,15 @@
   for (i = 100; i < 200; ++i)
     buf[i] = i;
   if (PWRITE (fd, buf + 100, 100, 100) != 100)
-    error (EXIT_FAILURE, errno, "during %s", STRINGIFY (PWRITE));
+    error (EXIT_FAILURE, errno, "during %s", __stringify (PWRITE));
 
   for (i = 450; i < 600; ++i)
     buf[i] = i;
   if (PWRITE (fd, buf + 450, 150, 450) != 150)
-    error (EXIT_FAILURE, errno, "during %s", STRINGIFY (PWRITE));
+    error (EXIT_FAILURE, errno, "during %s", __stringify (PWRITE));
 
   if (PREAD (fd, res, sizeof (buf) - 50, 50) != sizeof (buf) - 50)
-    error (EXIT_FAILURE, errno, "during %s", STRINGIFY (PREAD));
+    error (EXIT_FAILURE, errno, "during %s", __stringify (PREAD));
 
   close (fd);
   unlink (name);




More information about the uClibc-cvs mailing list