add mac os x compat #define for in6_addr s6_addr32
[project/netifd.git] / utils.h
diff --git a/utils.h b/utils.h
index ec22313..e159b42 100644 (file)
--- a/utils.h
+++ b/utils.h
 #include <libubox/avl-cmp.h>
 #include <libubox/blobmsg.h>
 #include <libubox/vlist.h>
-
-#ifndef __OPTIMIZE__
-#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
-#else
-extern int __build_bug_on_failed;
-#define BUILD_BUG_ON(condition)                                 \
-       do {                                                    \
-               ((void)sizeof(char[1 - 2*!!(condition)]));  \
-               if (condition) __build_bug_on_failed = 1;   \
-       } while(0)
-#endif
+#include <libubox/utils.h>
 
 static inline bool blobmsg_get_bool_default(struct blob_attr *attr, bool val)
 {
@@ -114,4 +104,10 @@ unsigned int parse_netmask_string(const char *str, bool v6);
 bool split_netmask(char *str, unsigned int *netmask, bool v6);
 int parse_ip_and_netmask(int af, const char *str, void *addr, unsigned int *netmask);
 
+char * format_macaddr(uint8_t *mac);
+
+#ifdef __APPLE__
+#define s6_addr32      __u6_addr.__u6_addr32
+#endif
+
 #endif