Commit 9c71d3f2 authored by Alessandro Rubini's avatar Alessandro Rubini

ppsi.h: forcibly include autoconf.h, and define ARRAY_SIZE

In the next commits we'll need CONFIG_ symbols and ARRAY_SIZE

Unfortunately, we can't use "-include include/generated/autoconf.h"
in CFLAGS, because pp_printf is built with our CFLAGS from its own
directory. And I'd better not include the full pathname as our make
is verbose
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent e8b88ab5
......@@ -7,6 +7,7 @@
#ifndef __PPSI_PPSI_H__
#define __PPSI_PPSI_H__
#include <generated/autoconf.h>
#include <stdint.h>
#include <stdarg.h>
......@@ -20,6 +21,10 @@
#include <arch/arch.h> /* ntohs and so on -- and wr-api.h for wr archs */
/* At this point in time, we need ARRAY_SIZE to conditionally build vlan code */
#undef ARRAY_SIZE
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
/* We can't include pp-printf.h when building freestading, so have it here */
extern int pp_printf(const char *fmt, ...)
__attribute__((format(printf, 1, 2)));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment