X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fuci.git;a=blobdiff_plain;f=uci.h;h=43f2052a00e6901e67cd6d1956fdb36375b41358;hp=c5583ed0f798a081e964ba120760c59d179b36e2;hb=5beb95da3dbec6db11a6bdfaab7807ee2daf41e6;hpb=c203c2f9009a322e5e774ff8cd32bac2fa3b7961 diff --git a/uci.h b/uci.h index c5583ed..43f2052 100644 --- a/uci.h +++ b/uci.h @@ -689,6 +689,15 @@ uci_lookup_option_string(struct uci_context *ctx, struct uci_section *s, const c return o->v.string; } +#ifndef BITS_PER_LONG +#define BITS_PER_LONG (8 * sizeof(unsigned long)) +#endif + +static inline void uci_bitfield_set(unsigned long *bits, int bit) +{ + bits[bit / BITS_PER_LONG] |= (1UL << (bit % BITS_PER_LONG)); +} + #ifdef __cplusplus } #endif