libev/update_ev_wrap

20 lines
501 B
Plaintext
Raw Normal View History

2007-11-04 00:24:16 +00:00
#!/bin/sh
(
2007-12-20 07:12:57 +00:00
echo '#define VAR(name,decl) name'
2007-11-04 00:24:16 +00:00
echo '#define EV_GENWRAP 1'
cat ev_vars.h
2007-12-20 07:12:57 +00:00
) | cc -E -o - - | perl -ne '
while (<>) {
push @syms, $1 if /(^\w+)/;
}
print "/* DO NOT EDIT, automatically generated by update_ev_wrap */\n",
"#ifndef EV_WRAP_H\n",
"#define EV_WRAP_H\n",
2012-05-06 13:05:35 +00:00
(map "#define $_ ((loop)->$_)\n", sort @syms),
2007-12-20 07:12:57 +00:00
"#else\n",
"#undef EV_WRAP_H\n",
2012-05-06 13:09:12 +00:00
(map "#undef $_\n", @syms),
2007-12-20 07:12:57 +00:00
"#endif\n";
' >ev_wrap.h