[PATCH 6/7] Optional struct _reent::_new::_reent::_unused_rand

Sebastian Huber <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
Provide struct _reent::_new::_reent::_unused_rand only if
_NEWLIB_BACKWARD_BINARY_COMPAT is defined.
---
 newlib/libc/include/sys/reent.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/newlib/libc/include/sys/reent.h b/newlib/libc/include/sys/reent.h
index 5e154cae8..c21f11de2 100644
--- a/newlib/libc/include/sys/reent.h
+++ b/newlib/libc/include/sys/reent.h
@@ -344,9 +344,11 @@ struct _rand48 {
 
 #ifdef _NEWLIB_BACKWARD_BINARY_COMPAT
 #define _REENT_INIT_UNUSED_LOCALE_INFO 0,
+#define _REENT_INIT_UNUSED_RAND 0,
 #define _REENT_INIT_UNUSED_SDIDINIT 0,
 #else
 #define _REENT_INIT_UNUSED_LOCALE_INFO /* Nothing to initialize */
+#define _REENT_INIT_UNUSED_RAND /* Nothing to initialize */
 #define _REENT_INIT_UNUSED_SDIDINIT /* Nothing to initialize */
 #endif
 
@@ -667,7 +669,9 @@ struct _reent
     {
       struct
         {
+#ifdef _NEWLIB_BACKWARD_BINARY_COMPAT
           unsigned int _unused_rand;
+#endif
           char * _strtok_last;
           char _asctime_buf[_REENT_ASCTIME_SIZE];
           struct __tm _localtime_buf;
@@ -749,7 +753,7 @@ struct _reent
     _NULL, \
     { \
       { \
-        0, \
+        _REENT_INIT_UNUSED_RAND \
         _NULL, \
         "", \
         {0, 0, 0, 0, 0, 0, 0, 0, 0}, \
-- 
2.35.3
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.