]> xenbits.xensource.com Git - libvirt.git/commit
API: make declaration of _LAST enum values conditional
authorEric Blake <eblake@redhat.com>
Fri, 20 Jan 2012 18:43:28 +0000 (11:43 -0700)
committerEric Blake <eblake@redhat.com>
Fri, 20 Jan 2012 23:05:51 +0000 (16:05 -0700)
commit7b4e5693c13d5de1f0e14abda029e3148cbbe12f
treebdda5f04b656230e56d9290e8dd58eb6c9020aab
parentc2551bea56d9fcfa4feeca17657c63efaf5d110e
API: make declaration of _LAST enum values conditional

Although this is a public API break, it only affects users that
were compiling against *_LAST values, and can be trivially
worked around without impacting compilation against older
headers, by the user defining VIR_ENUM_SENTINELS before using
libvirt.h.  It is not an ABI break, since enum values do not
appear as .so entry points.  Meanwhile, it prevents users from
using non-stable enum values without explicitly acknowledging
the risk of doing so.

See this list discussion:
https://www.redhat.com/archives/libvir-list/2012-January/msg00804.html

* include/libvirt/libvirt.h.in: Hide all sentinels behind
LIBVIRT_ENUM_SENTINELS, and add missing sentinels.
* src/internal.h (VIR_DEPRECATED): Allow inclusion after
libvirt.h.
(LIBVIRT_ENUM_SENTINELS): Expose sentinels internally.
* daemon/libvirtd.h: Use the sentinels.
* src/remote/remote_protocol.x (includes): Don't expose sentinels.
* python/generator.py (enum): Likewise.
* tests/cputest.c (cpuTestCompResStr): Silence compiler warning.
* tools/virsh.c (vshDomainStateReasonToString)
(vshDomainControlStateToString): Likewise.
daemon/libvirtd.h
include/libvirt/libvirt.h.in
python/generator.py
src/internal.h
src/remote/remote_protocol.x
tests/cputest.c
tools/virsh.c