Replace compile-time #ifdef with a runtime check to ensure all code paths are built and tested. This reduces build-time configuration complexity and improves maintainability.
No functional change intended. Signed-off-by: Philippe Mathieu-Daudé <[email protected]> --- ui/vdagent.c | 16 ++++++++-------- ui/vnc.c | 6 +----- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/ui/vdagent.c b/ui/vdagent.c index ddb91e75c64..66dc33567df 100644 --- a/ui/vdagent.c +++ b/ui/vdagent.c @@ -660,14 +660,14 @@ static void vdagent_chr_open(Chardev *chr, VDAgentChardev *vd = QEMU_VDAGENT_CHARDEV(chr); ChardevQemuVDAgent *cfg = backend->u.qemu_vdagent.data; -#if HOST_BIG_ENDIAN - /* - * TODO: vdagent protocol is defined to be LE, - * so we have to byteswap everything on BE hosts. - */ - error_setg(errp, "vdagent is not supported on bigendian hosts"); - return; -#endif + if (HOST_BIG_ENDIAN) { + /* + * TODO: vdagent protocol is defined to be LE, + * so we have to byteswap everything on BE hosts. + */ + error_setg(errp, "vdagent is not supported on bigendian hosts"); + return; + } vd->mouse = VDAGENT_MOUSE_DEFAULT; if (cfg->has_mouse) { diff --git a/ui/vnc.c b/ui/vnc.c index 77c823bf2e8..e93b5335690 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -2348,11 +2348,7 @@ static void pixel_format_message (VncState *vs) { vnc_write_u8(vs, vs->client_pf.bits_per_pixel); /* bits-per-pixel */ vnc_write_u8(vs, vs->client_pf.depth); /* depth */ -#if HOST_BIG_ENDIAN - vnc_write_u8(vs, 1); /* big-endian-flag */ -#else - vnc_write_u8(vs, 0); /* big-endian-flag */ -#endif + vnc_write_u8(vs, HOST_BIG_ENDIAN); /* big-endian-flag */ vnc_write_u8(vs, 1); /* true-color-flag */ vnc_write_u16(vs, vs->client_pf.rmax); /* red-max */ vnc_write_u16(vs, vs->client_pf.gmax); /* green-max */ -- 2.51.0
