Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/newlib
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2011-03-03 13:37:09 +0300
committerCorinna Vinschen <corinna@vinschen.de>2011-03-03 13:37:09 +0300
commit977cd4175e7e834007f79e484c690b9159ee03bd (patch)
treede87071f3e485a4f26fd0715ea6ab68ac3e99ae2 /newlib
parentb7351dcfb1863332e36eebc380d99e13f12e60b8 (diff)
* libc/include/sys/cdefs.h (__CONCAT1): Define.
(__CONCAT): Define. (__STRING): Define. (__XSTRING): Define. (__ASMNAME): Define. * libc/include/string.h (strerror_r): Use __ASMNAME to take target specific label prefixes into account.
Diffstat (limited to 'newlib')
-rw-r--r--newlib/ChangeLog10
-rw-r--r--newlib/libc/include/string.h2
-rw-r--r--newlib/libc/include/sys/cdefs.h21
3 files changed, 32 insertions, 1 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog
index 43811b569..2541b5ec2 100644
--- a/newlib/ChangeLog
+++ b/newlib/ChangeLog
@@ -1,3 +1,13 @@
+2011-03-03 Corinna Vinschen <vinschen@redhat.com>
+
+ * libc/include/sys/cdefs.h (__CONCAT1): Define.
+ (__CONCAT): Define.
+ (__STRING): Define.
+ (__XSTRING): Define.
+ (__ASMNAME): Define.
+ * libc/include/string.h (strerror_r): Use __ASMNAME to take target
+ specific label prefixes into account.
+
2011-03-01 Aaron Landwehr <snaphat@gmail.com>
* libm/complex/cproj.c: Fix typo.
diff --git a/newlib/libc/include/string.h b/newlib/libc/include/string.h
index 7202b06ab..09d065e12 100644
--- a/newlib/libc/include/string.h
+++ b/newlib/libc/include/string.h
@@ -74,7 +74,7 @@ char *_EXFUN(_strndup_r,(struct _reent *, const char *, size_t));
char *_EXFUN(strerror_r,(int, char *, size_t));
#else
# ifdef __GNUC__
-int _EXFUN(strerror_r,(int, char *, size_t)) __asm__ ("__xpg_strerror_r");
+int _EXFUN(strerror_r,(int, char *, size_t)) __asm__ (__ASMNAME ("__xpg_strerror_r"));
# else
int _EXFUN(__xpg_strerror_r,(int, char *, size_t));
# define strerror_r __xpg_strerror_r
diff --git a/newlib/libc/include/sys/cdefs.h b/newlib/libc/include/sys/cdefs.h
index f0b6a27b4..e3298efaf 100644
--- a/newlib/libc/include/sys/cdefs.h
+++ b/newlib/libc/include/sys/cdefs.h
@@ -58,6 +58,27 @@
#define __DOTS , ...
#define __THROW
+/*
+ * The __CONCAT macro is used to concatenate parts of symbol names, e.g.
+ * with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo.
+ * The __CONCAT macro is a bit tricky to use if it must work in non-ANSI
+ * mode -- there must be no spaces between its arguments, and for nested
+ * __CONCAT's, all the __CONCAT's must be at the left. __CONCAT can also
+ * concatenate double-quoted strings produced by the __STRING macro, but
+ * this only works with ANSI C.
+ *
+ * __XSTRING is like __STRING, but it expands any macros in its argument
+ * first. It is only available with ANSI C.
+ */
+#define __CONCAT1(x,y) x ## y
+#define __CONCAT(x,y) __CONCAT1(x,y)
+#define __STRING(x) #x /* stringify without expanding x */
+#define __XSTRING(x) __STRING(x) /* expand x, then stringify */
+
+#ifdef __GNUC__
+# define __ASMNAME(cname) __XSTRING (__USER_LABEL_PREFIX__) cname
+#endif
+
#define __ptr_t void *
#define __long_double_t long double