Would some variant of the usual C / C++ guitar lick work? #ifndef __defined_my_types #define __defined_my_types #include <mytypes.api> #endif /* __defined_my_types */
-----Original Message----- From: Ole Troan [mailto:otr...@employees.org] Sent: Monday, November 20, 2017 10:32 AM To: Dave Barach (dbarach) <dbar...@cisco.com> Cc: Neale Ranns (nranns) <nra...@cisco.com>; vpp-dev@lists.fd.io Subject: Re: [vpp-dev] Import/includes in .api files Dave, > Since the beginning of time, we've been running .api files through the C > preprocessor. Put all of your "typeonly..." definitions in a file, and > #include it. Should work immediately. > > Thanks to Damjan, there's only one copy of the suffix rule, in > .../src/suffix-rules.mk. Here's the relevant rule: > > %.api.h: %.api @VPPAPIGEN@ > @echo " APIGEN " $@ ; \ > mkdir -p `dirname $@` ; \ > $(CC) $(CPPFLAGS) -E -P -C -x c $< \ > | @VPPAPIGEN@ --input - --output $@ --show-name $@ > /dev/null Sorry, for misunderstanding, this seems to work perfectly fine with the language bindings. Verified by moving fib_path to types.api and comparing the resulting ip.api.json. Need to figure how to deal with duplicates, which will end up in the .JSON definitions when multiple .api include the same file. That shouldn't be a big deal though. Best regards, Ole _______________________________________________ vpp-dev mailing list vpp-dev@lists.fd.io https://lists.fd.io/mailman/listinfo/vpp-dev