X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fnetifd.git;a=blobdiff_plain;f=utils.h;h=e159b42a70c385d5b7acaa666b5473535f6db16b;hp=ec2231331c9d1cdbe4828b95f238e1268ffb7ca4;hb=9908adbd9a31c92f13b05f0c057d4429edbc5184;hpb=1ada8cef980df7871b12ed230c789eb28f6cb047 diff --git a/utils.h b/utils.h index ec22313..e159b42 100644 --- a/utils.h +++ b/utils.h @@ -19,17 +19,7 @@ #include #include #include - -#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 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