shithub: scc

Download patch

ref: 68fc5b73b8cc4ba666d8d30d74762c71a0653a9d
parent: 0f595fa896765dfdbe88c760ebd97edd8a1f123b
author: Michael Forney <[email protected]>
date: Sat Oct 2 21:59:19 EDT 2021

libc: Add inttypes.h

For now, only linux-amd64 provides it.

--- /dev/null
+++ b/include/bits/linux/amd64/arch/inttypes.h
@@ -1,0 +1,181 @@
+#define PRId8 "hhd"
+#define PRIi8 "hhi"
+#define PRIo8 "hho"
+#define PRIu8 "hhu"
+#define PRIx8 "hhx"
+#define PRIX8 "hhX"
+
+#define PRId16 "hd"
+#define PRIi16 "hi"
+#define PRIo16 "ho"
+#define PRIu16 "hu"
+#define PRIx16 "hx"
+#define PRIX16 "hX"
+
+#define PRId32 "d"
+#define PRIi32 "i"
+#define PRIo32 "o"
+#define PRIu32 "u"
+#define PRIx32 "x"
+#define PRIX32 "X"
+
+#define PRId64 "ld"
+#define PRIi64 "li"
+#define PRIo64 "lo"
+#define PRIu64 "lu"
+#define PRIx64 "lx"
+#define PRIX64 "lX"
+
+#define PRIdLEAST8 "hhd"
+#define PRIiLEAST8 "hhi"
+#define PRIoLEAST8 "hho"
+#define PRIuLEAST8 "hhu"
+#define PRIxLEAST8 "hhx"
+#define PRIXLEAST8 "hhX"
+
+#define PRIdLEAST16 "hd"
+#define PRIiLEAST16 "hi"
+#define PRIoLEAST16 "ho"
+#define PRIuLEAST16 "hu"
+#define PRIxLEAST16 "hx"
+#define PRIXLEAST16 "hX"
+
+#define PRIdLEAST32 "d"
+#define PRIiLEAST32 "i"
+#define PRIoLEAST32 "o"
+#define PRIuLEAST32 "u"
+#define PRIxLEAST32 "x"
+#define PRIXLEAST32 "X"
+
+#define PRIdLEAST64 "ld"
+#define PRIiLEAST64 "li"
+#define PRIoLEAST64 "lo"
+#define PRIuLEAST64 "lu"
+#define PRIxLEAST64 "lx"
+#define PRIXLEAST64 "lX"
+
+#define PRIdFAST8 "hhd"
+#define PRIiFAST8 "hhi"
+#define PRIoFAST8 "hho"
+#define PRIuFAST8 "hhu"
+#define PRIxFAST8 "hhx"
+#define PRIXFAST8 "hhX"
+
+#define PRIdFAST16 "d"
+#define PRIiFAST16 "i"
+#define PRIoFAST16 "o"
+#define PRIuFAST16 "u"
+#define PRIxFAST16 "x"
+#define PRIXFAST16 "X"
+
+#define PRIdFAST32 "d"
+#define PRIiFAST32 "i"
+#define PRIoFAST32 "o"
+#define PRIuFAST32 "u"
+#define PRIxFAST32 "x"
+#define PRIXFAST32 "X"
+
+#define PRIdFAST64 "ld"
+#define PRIiFAST64 "li"
+#define PRIoFAST64 "lo"
+#define PRIuFAST64 "lu"
+#define PRIxFAST64 "lx"
+#define PRIXFAST64 "lX"
+
+#define PRIdPTR "ld"
+#define PRIiPTR "li"
+#define PRIoPTR "lo"
+#define PRIuPTR "lu"
+#define PRIxPTR "lx"
+#define PRIXPTR "lX"
+
+#define PRIdMAX "ld"
+#define PRIiMAX "li"
+#define PRIoMAX "lo"
+#define PRIuMAX "lu"
+#define PRIxMAX "lx"
+#define PRIXMAX "lX"
+
+#define SCNd8 "hhd"
+#define SCNi8 "hhi"
+#define SCNo8 "hho"
+#define SCNu8 "hhu"
+#define SCNx8 "hhx"
+
+#define SCNd16 "hd"
+#define SCNi16 "hi"
+#define SCNo16 "ho"
+#define SCNu16 "hu"
+#define SCNx16 "hx"
+
+#define SCNd32 "d"
+#define SCNi32 "i"
+#define SCNo32 "o"
+#define SCNu32 "u"
+#define SCNx32 "x"
+
+#define SCNd64 "ld"
+#define SCNi64 "li"
+#define SCNo64 "lo"
+#define SCNu64 "lu"
+#define SCNx64 "lx"
+
+#define SCNdLEAST8 "hhd"
+#define SCNiLEAST8 "hhi"
+#define SCNoLEAST8 "hho"
+#define SCNuLEAST8 "hhu"
+#define SCNxLEAST8 "hhx"
+
+#define SCNdLEAST16 "hd"
+#define SCNiLEAST16 "hi"
+#define SCNoLEAST16 "ho"
+#define SCNuLEAST16 "hu"
+#define SCNxLEAST16 "hx"
+
+#define SCNdLEAST32 "d"
+#define SCNiLEAST32 "i"
+#define SCNoLEAST32 "o"
+#define SCNuLEAST32 "u"
+#define SCNxLEAST32 "x"
+
+#define SCNdLEAST64 "ld"
+#define SCNiLEAST64 "li"
+#define SCNoLEAST64 "lo"
+#define SCNuLEAST64 "lu"
+#define SCNxLEAST64 "lx"
+
+#define SCNdFAST8 "hhd"
+#define SCNiFAST8 "hhi"
+#define SCNoFAST8 "hho"
+#define SCNuFAST8 "hhu"
+#define SCNxFAST8 "hhx"
+
+#define SCNdFAST16 "d"
+#define SCNiFAST16 "i"
+#define SCNoFAST16 "o"
+#define SCNuFAST16 "u"
+#define SCNxFAST16 "x"
+
+#define SCNdFAST32 "d"
+#define SCNiFAST32 "i"
+#define SCNoFAST32 "o"
+#define SCNuFAST32 "u"
+#define SCNxFAST32 "x"
+
+#define SCNdFAST64 "ld"
+#define SCNiFAST64 "li"
+#define SCNoFAST64 "lo"
+#define SCNuFAST64 "lu"
+#define SCNxFAST64 "lx"
+
+#define SCNdPTR "ld"
+#define SCNiPTR "li"
+#define SCNoPTR "lo"
+#define SCNuPTR "lu"
+#define SCNxPTR "lx"
+
+#define SCNdMAX "ld"
+#define SCNiMAX "li"
+#define SCNoMAX "lo"
+#define SCNuMAX "lu"
+#define SCNxMAX "lx"
--- /dev/null
+++ b/include/inttypes.h
@@ -1,0 +1,7 @@
+#ifndef _INTTYPES_H_
+#define _INTTYPES_H_
+
+#include <stdint.h>
+#include <arch/inttypes.h>
+
+#endif