]> xenbits.xensource.com Git - xen.git/commit
tools/ocaml: Fix redefinition errors
authorCostin Lupu <costin.lupu@cs.pub.ro>
Tue, 8 Jun 2021 12:35:29 +0000 (15:35 +0300)
committerJulien Grall <jgrall@amazon.com>
Fri, 9 Jul 2021 15:00:09 +0000 (16:00 +0100)
commit2d1a35f1e6c2113a6322fdb758a198608c90e4bd
tree860819f50a903b2dd63c2ca9f83f7df7adbf71df
parentd1b32abd94b620db05dfff0f4ce9cc17b9da0ccf
tools/ocaml: Fix redefinition errors

If PAGE_SIZE is already defined in the system (e.g. in /usr/include/limits.h
header) then gcc will trigger a redefinition error because of -Werror. This
patch replaces usage of PAGE_* macros with XC_PAGE_* macros in order to avoid
confusion between control domain page granularity (PAGE_* definitions) and
guest domain page granularity (which is what we are dealing with here).

Same issue applies for redefinitions of Val_none and Some_val macros which
can be already define in the OCaml system headers (e.g.
/usr/lib/ocaml/caml/mlvalues.h).

Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro>
Reviewed-by: Julien Grall <jgrall@amazon.com>
Acked-by: Ian Jackson <iwj@xenproject.org>
Tested-by: Dario Faggioli <dfaggioli@suse.com>
tools/ocaml/libs/xc/xenctrl_stubs.c
tools/ocaml/libs/xentoollog/xentoollog_stubs.c
tools/ocaml/libs/xl/xenlight_stubs.c