From cccd7a63a3e627e579fd26f289391f1c3a9f0c11 Mon Sep 17 00:00:00 2001
From: Guo Wenxue <guowenxue@gmail.com>
Date: Sat, 09 Apr 2022 13:53:24 +0800
Subject: [PATCH] update setup_systools shell script

---
 iotd/lylib/util_time.h |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/iotd/lylib/util_time.h b/iotd/lylib/util_time.h
index 05a2f9a..a48d8ae 100644
--- a/iotd/lylib/util_time.h
+++ b/iotd/lylib/util_time.h
@@ -25,6 +25,15 @@
 #include <sys/stat.h>
 #include <sys/time.h>
 
+
+#ifndef offsetof
+#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
+#endif
+
+#define container_of(ptr, type, member) ({      \
+        const typeof( ((type *)0)->member ) *__mptr = (ptr);    \
+        (type *)( (char *)__mptr - offsetof(type,member) );})
+
 typedef struct date_time_s
 {
     int year;

--
Gitblit v1.9.1