This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 7588da4f766 inttype.h: add PRIuTM(time_t) to handle TIME64 & TIME32 
print compatible
7588da4f766 is described below

commit 7588da4f766a7ced4d04337a49891626c2b3ed5e
Author: buxiasen <[email protected]>
AuthorDate: Wed May 21 14:34:25 2025 +0800

    inttype.h: add PRIuTM(time_t) to handle TIME64 & TIME32 print compatible
    
    After patch, we will no longer need cast to int64_t again.
    
    Signed-off-by: buxiasen <[email protected]>
---
 include/inttypes.h | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/include/inttypes.h b/include/inttypes.h
index 6111de0f8fa..b0dedee7f5e 100644
--- a/include/inttypes.h
+++ b/include/inttypes.h
@@ -338,6 +338,36 @@
 #define SCNxOFF     SCNx32
 #endif
 
+/* time_t */
+
+#ifdef CONFIG_SYSTEM_TIME64
+#define PRIdTM      PRId64
+#define PRIiTM      PRIi64
+#define PRIoTM      PRIo64
+#define PRIuTM      PRIu64
+#define PRIxTM      PRIx64
+#define PRIXTM      PRIX64
+
+#define SCNdTM      SCNd64
+#define SCNiTM      SCNi64
+#define SCNoTM      SCNo64
+#define SCNuTM      SCNu64
+#define SCNxTM      SCNx64
+#else
+#define PRIdTM      PRId32
+#define PRIiTM      PRIi32
+#define PRIoTM      PRIo32
+#define PRIuTM      PRIu32
+#define PRIxTM      PRIx32
+#define PRIXTM      PRIX32
+
+#define SCNdTM      SCNd32
+#define SCNiTM      SCNi32
+#define SCNoTM      SCNo32
+#define SCNuTM      SCNu32
+#define SCNxTM      SCNx32
+#endif
+
 /****************************************************************************
  * Type Definitions
  ****************************************************************************/

Reply via email to