[PATCH] H8: Minor cleanup in newlib/libc/include/sys/config.h.

Jan Dubiec <[email protected]> Mon, 13 Jul 2026 04:17:58 +0200
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
This patch defines the _POINTER_INT, _READ_WRITE_RETURN_TYPE, and
_READ_WRITE_BUFSIZE_TYPE macros explicitly for the H8 family, avoiding the
use of their default definitions. It also removes the unused H8300 macro.

Signed-off-by: Jan Dubiec <[email protected]>
---
 newlib/libc/include/sys/config.h | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/newlib/libc/include/sys/config.h b/newlib/libc/include/sys/config.h
index c3cd51e86..7fbcb4992 100644
--- a/newlib/libc/include/sys/config.h
+++ b/newlib/libc/include/sys/config.h
@@ -20,9 +20,6 @@
 /* exceptions first */
 #if defined(__H8500__) || defined(__W65__)
 #define __SMALL_BITFIELDS
-/* ???  This conditional is true for the h8500 and the w65, defining H8300
-   in those cases probably isn't the right thing to do.  */
-#define H8300 1
 #endif
 
 /* 16 bit integer machines */
@@ -36,16 +33,18 @@
 
 #if defined (__H8300__) || defined (__H8300H__) || defined(__H8300S__) || defined (__H8300SX__)
 #define __SMALL_BITFIELDS
-#define H8300 1
 #undef INT_MAX
 #undef UINT_MAX
 #define INT_MAX __INT_MAX__
 #define UINT_MAX (__INT_MAX__ * 2U + 1)
+#define _POINTER_INT __INTPTR_TYPE__
+#define _READ_WRITE_RETURN_TYPE _ssize_t
+#define _READ_WRITE_BUFSIZE_TYPE size_t
 #endif
 
 #if (defined(__CR16__) || defined(__CR16C__) ||defined(__CR16CP__))
 #ifndef __INT32__
-#define __SMALL_BITFIELDS      
+#define __SMALL_BITFIELDS
 #undef INT_MAX
 #undef UINT_MAX
 #define INT_MAX 32767
-- 
2.54.0