#8025 Introduces inline conditional include logic for system headers in exported public API headers. For example, in dr_defines.h (generated from globals_api.h):
#ifdef LINUX_KERNEL
# include <linux/stdarg.h>
#else
# include <stdarg.h> /* for varargs */
#endif
This duplicates the logic in stdarg_wrapper.h. However, because stdarg_wrapper.h is not exported, we cannot use it in dr_defines.h. This clutters exported public headers and duplicates the wrapper logic.
We think the proper solution is to use CMake configure-time variable substitution (configure_file with @ONLY) when exporting public API headers, such that system header dependencies are resolved at build configuration time.
#8025 Introduces inline conditional include logic for system headers in exported public API headers. For example, in
dr_defines.h(generated fromglobals_api.h):This duplicates the logic in
stdarg_wrapper.h. However, becausestdarg_wrapper.his not exported, we cannot use it indr_defines.h. This clutters exported public headers and duplicates the wrapper logic.We think the proper solution is to use CMake configure-time variable substitution (
configure_filewith@ONLY) when exporting public API headers, such that system header dependencies are resolved at build configuration time.