public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Extend _intsup.h to support 16-bit and 20-bit pointers.
@ 2015-10-19 13:49 Nick Clifton
0 siblings, 0 replies; only message in thread
From: Nick Clifton @ 2015-10-19 13:49 UTC (permalink / raw)
To: newlib-cvs
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=c3b6da1781011414436071bfc3a4dd9dad21d2e3
commit c3b6da1781011414436071bfc3a4dd9dad21d2e3
Author: Nick Clifton <nickc@redhat.com>
Date: Mon Oct 19 14:48:30 2015 +0100
Extend _intsup.h to support 16-bit and 20-bit pointers.
* libc/include/sys/_intsup.h: Add support for 16-bit and 20-bit
pointers.
Diff:
---
newlib/ChangeLog | 5 +++++
newlib/libc/include/sys/_intsup.h | 11 ++++++++++-
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/newlib/ChangeLog b/newlib/ChangeLog
index fe58362..94b1f7b 100644
--- a/newlib/ChangeLog
+++ b/newlib/ChangeLog
@@ -1,3 +1,8 @@
+2015-10-19 Nick Clifton <nickc@redhat.com>
+
+ * libc/include/sys/_intsup.h: Add support for 16-bit and 20-bit
+ pointers.
+
2015-10-14 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libc/stdlib/Makefile.am (GENERAL_SOURCES): Add alloc_aligned.c.c.
diff --git a/newlib/libc/include/sys/_intsup.h b/newlib/libc/include/sys/_intsup.h
index ea10431..b979d5c 100644
--- a/newlib/libc/include/sys/_intsup.h
+++ b/newlib/libc/include/sys/_intsup.h
@@ -50,6 +50,7 @@
#pragma push_macro("unsigned")
#pragma push_macro("char")
#pragma push_macro("short")
+#pragma push_macro("__int20")
#pragma push_macro("int")
#pragma push_macro("long")
#undef signed
@@ -57,19 +58,26 @@
#undef char
#undef short
#undef int
+#undef __int20
#undef long
#define signed +0
#define unsigned +0
#define char +0
#define short +1
+#define __int20 +2
#define int +2
#define long +4
#if (__INTPTR_TYPE__ == 8 || __INTPTR_TYPE__ == 10)
#define _INTPTR_EQ_LONGLONG
#elif (__INTPTR_TYPE__ == 4 || __INTPTR_TYPE__ == 6)
#define _INTPTR_EQ_LONG
+/* Note - the tests for _INTPTR_EQ_INT and _INTPTR_EQ_SHORT are currently
+ redundant as the values are not used. But one day they may be needed
+ and so the tests remain. */
#elif __INTPTR_TYPE__ == 2
-/* Nothing to define because intptr_t is safe to print as an int. */
+#define _INTPTR_EQ_INT
+#elif (__INTPTR_TYPE__ == 1 || __INTPTR_TYPE__ == 3)
+#define _INTPTR_EQ_SHORT
#else
#error "Unable to determine type definition of intptr_t"
#endif
@@ -194,6 +202,7 @@
#pragma pop_macro("unsigned")
#pragma pop_macro("char")
#pragma pop_macro("short")
+#pragma pop_macro("__int20")
#pragma pop_macro("int")
#pragma pop_macro("long")
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-10-19 13:49 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-19 13:49 [newlib-cygwin] Extend _intsup.h to support 16-bit and 20-bit pointers Nick Clifton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).