This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
[PATCH] Support __int20__ type in _intsup.h
- From: Jozef Lawrynowicz <jozef dot l at mittosystems dot com>
- To: newlib at sourceware dot org
- Date: Tue, 25 Jun 2019 12:05:28 +0100
- Subject: [PATCH] Support __int20__ type in _intsup.h
A new patch to GCC (r272640) modifies the MSP430 target to use "__int20__" for
PTRDIFF_TYPE (and therefore INTPTR_TYPE) instead of "__int20".
To support the calculation of pointer size in
newlib/libc/include/sys/_intsup.h, definitions for __int20__ need to be added.
Patch is attached.
If the patch is acceptable I would appreciate if someone would commit it for
me, as I do not have write access.
Thanks,
Jozef
>From 98c85b87043eea5a03a0f57476cb64de20bd03a8 Mon Sep 17 00:00:00 2001
From: Jozef Lawrynowicz <jozef.l@mittosystems.com>
Date: Tue, 25 Jun 2019 11:45:02 +0100
Subject: [PATCH] Support calculation of pointer size for __int20__ type in
_intsup.h
GCC r272640 modifies the MSP430 target to use "__int20__" for
PTRDIFF_TYPE (and therefore INTPTR_TYPE) instead of "__int20".
To support the calculation of pointer size in
newlib/libc/include/sys/_intsup.h, definitions for __int20__ need to be
added.
---
newlib/libc/include/sys/_intsup.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/newlib/libc/include/sys/_intsup.h b/newlib/libc/include/sys/_intsup.h
index 88d7400d8..993121ba8 100644
--- a/newlib/libc/include/sys/_intsup.h
+++ b/newlib/libc/include/sys/_intsup.h
@@ -37,6 +37,7 @@
#pragma push_macro("char")
#pragma push_macro("short")
#pragma push_macro("__int20")
+#pragma push_macro("__int20__")
#pragma push_macro("int")
#pragma push_macro("long")
#undef signed
@@ -45,12 +46,14 @@
#undef short
#undef int
#undef __int20
+#undef __int20__
#undef long
#define signed +0
#define unsigned +0
#define char +0
#define short +1
#define __int20 +2
+#define __int20__ +2
#define int +2
#define long +4
#if (__INTPTR_TYPE__ == 8 || __INTPTR_TYPE__ == 10)
@@ -189,6 +192,7 @@
#pragma pop_macro("char")
#pragma pop_macro("short")
#pragma pop_macro("__int20")
+#pragma pop_macro("__int20__")
#pragma pop_macro("int")
#pragma pop_macro("long")
--
2.17.1