<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<br>
<br>
<div class="moz-cite-prefix">Le 21/06/2023 à 06:28, Nicholas Piggin
a écrit :<br>
</div>
<blockquote type="cite" cite="mid:CTI1MH3PO2IA.28A901RM7TWI@wheely">
<pre class="moz-quote-pre" wrap="">On Wed Jun 21, 2023 at 12:51 AM AEST, Christophe Lombard wrote:
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">Add maximum native integer size and limits of specified-width integer
types.
These types are required by the external library: libpldm.
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
For the libc and include changes, maybe add something in
libc/README.txt? It's not quite so well documented as some
other imports unfortunately.
Some changes look like they might be able to go upstream
too. But probably libc cleanup and rebase is a project all
on its own :(
Anyway these look fine for the most part except... libstb
defines a SIZE_MAX :( Is there any way the beams could cross?
Could libstb just use this one? (I wonder if that was a skiboot
specific change)
</pre>
</blockquote>
<br>
<span class="HwtZe" lang="en"><span class="jCAhz ChMk0b"><span
class="ryNqvb">This is indeed a point to consider.</span></span>
<span class="jCAhz ChMk0b"><span class="ryNqvb">I will look.<br>
<br>
Thanks<br>
<br>
</span></span></span>
<blockquote type="cite" cite="mid:CTI1MH3PO2IA.28A901RM7TWI@wheely">
<pre class="moz-quote-pre" wrap="">
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">
Signed-off-by: Christophe Lombard <a class="moz-txt-link-rfc2396E" href="mailto:clombard@linux.ibm.com"><clombard@linux.ibm.com></a>
---
libc/include/limits.h | 6 ++++++
libc/include/stdint.h | 3 +++
2 files changed, 9 insertions(+)
diff --git a/libc/include/limits.h b/libc/include/limits.h
index bfde9635..0c85d2e2 100644
--- a/libc/include/limits.h
+++ b/libc/include/limits.h
@@ -33,5 +33,11 @@
#define UINT32_MAX UINT_MAX
#define INT32_MAX INT_MAX
+#define UINT16_MAX USHRT_MAX
+#define UINT8_MAX UCHAR_MAX
+
+#ifndef SIZE_MAX
+#define SIZE_MAX (~0ull)
+#endif
#endif
diff --git a/libc/include/stdint.h b/libc/include/stdint.h
index 2a2c1d91..080d875a 100644
--- a/libc/include/stdint.h
+++ b/libc/include/stdint.h
@@ -13,6 +13,9 @@
#ifndef _STDINT_H
#define _STDINT_H
+/* C99 requires *_MAX to be in stdint.h */
+#include <limits.h>
+
typedef unsigned char uint8_t;
typedef signed char int8_t;
--
2.40.1
_______________________________________________
Skiboot mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Skiboot@lists.ozlabs.org">Skiboot@lists.ozlabs.org</a>
<a class="moz-txt-link-freetext" href="https://lists.ozlabs.org/listinfo/skiboot">https://lists.ozlabs.org/listinfo/skiboot</a>
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
</pre>
</blockquote>
<br>
</body>
</html>