]> granicus.if.org Git - strace/commit
mpers: add support of conditionally compiled printers
authorDmitry V. Levin <ldv@altlinux.org>
Sat, 21 May 2016 22:53:06 +0000 (22:53 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sat, 21 May 2016 22:53:06 +0000 (22:53 +0000)
commita8fce09e344a644aa0279f0efe54e4faeb64ca29
tree54d542dc34bb18022ac484dd187bdaab370182a6
parent4bf7ab7005b0fb53d8894c70ebdb6c1cfa075330
mpers: add support of conditionally compiled printers

We used to declare and define all printers marked with
MPERS_PRINTER_DECL, including ifdef'ed ones.  That approach left us
no way to conditionally compile mpersified printers, which was not
a problem until btrfs ioctls appeared on the horizon.

With this change, those mpersified printers that are not going
to be compiled are also won't be declared and won't be added to
struct_printers.

This is implemented by filtering all source files containing
MPERS_PRINTER_DECL markers through CPP.  As a nice side effect, this
also lifts an ugly requirement of writing all MPERS_PRINTER_DECL
declarations in a single line.

* README-mpers: Update description of MPERS_PRINTER_DECL syntax.
* defs.h [IN_MPERS_BOOTSTRAP] (MPERS_PRINTER_DECL): Turn into
a recursive variadic macro.
[!IN_MPERS_BOOTSTRAP] (MPERS_PRINTER_DECL): Turn into a variadic macro.
All callers changed.
* Makefile.am (mpers_preproc_files, mpers_printer_decl_pattern):
New variables.
(CLEANFILES): Add $(mpers_preproc_files).
(%.c.mpers.i): New rule.
(printers.h, %_printer_decls.h, %_printer_defs.h): Use
mpers_preproc_files instead of srcdir_mpers_source_files,
use mpers_printer_decl_pattern.
* .gitignore: Add /*.mpers.i.
16 files changed:
.gitignore
Makefile.am
README-mpers
defs.h
fetch_seccomp_fprog.c
fetch_struct_flock.c
fetch_struct_statfs.c
mpers_type.h
print_mq_attr.c
print_msgbuf.c
print_sigevent.c
print_time.c
print_timex.c
printrusage.c
printsiginfo.c
v4l2.c