udebug: add more checks for uninitialized buffers
[project/libubox.git] / utils.h
diff --git a/utils.h b/utils.h
index 27f81e568bf5aa2d5c1bfe8cec883215e29593f1..dacac6e41092e2b395f3867fa6dd91812a40acf8 100644 (file)
--- a/utils.h
+++ b/utils.h
@@ -19,6 +19,7 @@
 #ifndef __LIBUBOX_UTILS_H
 #define __LIBUBOX_UTILS_H
 
+#include <sys/stat.h>
 #include <sys/types.h>
 #include <sys/time.h>
 #include <stdint.h>
@@ -226,6 +227,18 @@ int clock_gettime(int type, struct timespec *tv);
 #define __hidden __attribute__((visibility("hidden")))
 #endif
 
+#ifndef __has_attribute
+# define __has_attribute(x) 0
+#endif
+
+#ifndef fallthrough
+# if __has_attribute(__fallthrough__)
+#  define fallthrough __attribute__((__fallthrough__))
+# else
+#  define fallthrough do {} while (0)  /* fallthrough */
+# endif
+#endif
+
 int b64_encode(const void *src, size_t src_len,
               void *dest, size_t dest_len);
 
@@ -252,5 +265,6 @@ static inline unsigned long cbuf_size(int order)
 
 void *cbuf_alloc(unsigned int order);
 void cbuf_free(void *ptr, unsigned int order);
+int mkdir_p(char *dir, mode_t mask);
 
 #endif