[PATCH] Support __int20__ type in _intsup.h

Jozef Lawrynowicz <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <20190625120528.0829078b@jozef-kubuntu>
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
0001-Support-calculation-of-pointer-size-for-__int20__-ty.patch (text/x-patch, 1.5 KB)
From 98c85b87043eea5a03a0f57476cb64de20bd03a8 Mon Sep 17 00:00:00 2001
From: Jozef Lawrynowicz <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.