diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/array-size/array-size.h | 7 | ||||
-rw-r--r-- | lib/pb-config/storage-test.c | 4 |
2 files changed, 9 insertions, 2 deletions
diff --git a/lib/array-size/array-size.h b/lib/array-size/array-size.h new file mode 100644 index 0000000..12d59f8 --- /dev/null +++ b/lib/array-size/array-size.h @@ -0,0 +1,7 @@ +#ifndef ARRAY_SIZE_H +#define ARRAY_SIZE_H + +#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) + +#endif /* ARRAY_SIZE_H */ + diff --git a/lib/pb-config/storage-test.c b/lib/pb-config/storage-test.c index 3114712..3ce58ef 100644 --- a/lib/pb-config/storage-test.c +++ b/lib/pb-config/storage-test.c @@ -4,6 +4,8 @@ #include <sys/types.h> #include <sys/wait.h> +#include <array-size/array-size.h> + #include "pb-config.h" #include "storage.h" @@ -24,8 +26,6 @@ struct interface_config net2 = { struct interface_config *interface_configs[] = { &net1, &net2 }; const char *dns_servers[] = { "192.168.1.1", "192.168.1.2" }; -#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) - struct config test_config = { .autoboot_enabled = true, .network = { |