projects
/
project
/
uci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add bitfield_set function from libubox.
[project/uci.git]
/
uci.h
diff --git
a/uci.h
b/uci.h
index
c5583ed
..
43f2052
100644
(file)
--- 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;
}
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
#ifdef __cplusplus
}
#endif