I would like something like the following gperf input file:
%{
#include <keywords.h>
// the contents of which contain
// #define KEYWORD1_MACRO "keyword1"
// #define KEYWORD2_MACRO "keyword2"
%}
%%
KEYWORD1_MACRO
KEYWORD2_MACRO
%%
Unfortunately, gperf will interpret those as the stings "KEYWORD1_MACRO", etc.
The reason for this is that I have a protocol spec provided by another party as a header file, containing such #define
s. So I don't have control over how they are defined, and I'd rather not have to write another preprocessing tool to #include
the header and output the expansion of the macros as quoted strings, only then for use as a gperf input file.