#include <setjmp.h>
#include <stdio.h>
#include <stdint.h>
+#include <stddef.h>
#define UCI_CONFDIR "/etc/config"
#define UCI_SAVEDIR "/tmp/.uci"
};
-/* linked list handling */
-#ifndef offsetof
-#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
-#endif
-
/**
* container_of - cast a member of a structure out to the containing structure
* @ptr: the pointer to the member.
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