]> git.ipfire.org Git - thirdparty/libvirt.git/commit
scripts: emit raw enum value in API build description
authorDaniel P. Berrangé <berrange@redhat.com>
Tue, 19 May 2020 11:32:19 +0000 (12:32 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Fri, 22 May 2020 10:32:55 +0000 (11:32 +0100)
commit61fdc9670681843be9167a2aafadfc0803b5b77c
treed119ee5bbb03f7ab27a25b59c4fa4ae23f39401b
parent38f3fa61400dc087266a49cdc2499bb39dcf9b9b
scripts: emit raw enum value in API build description

Currently the value for an enum is only emitted if it is a plain
string. If the enum is an integer or hex value, or a complex code block,
it is omitted from the API build. This fixes that by emitting the raw
value if no string value is present.

With this change:

  <macro name='LIBVIR_CHECK_VERSION'
         file='libvirt-common'
         params='major,minor,micro'>
  <macro name='LIBVIR_VERSION_NUMBER'
         file='libvirt-common'>
  <macro name='VIR_COPY_CPUMAP'
         file='libvirt-domain'
         params='cpumaps,maplen,vcpu,cpumap'>
  ...snip...

  <macro name='LIBVIR_CHECK_VERSION'
         file='libvirt-common'
         params='major,minor,micro'
         raw='((major) * 1000000 + (minor) * 1000 + (micro) <= LIBVIR_VERSION_NUMBER)'>
  <macro name='LIBVIR_VERSION_NUMBER'
         file='libvirt-common'
         raw='6004000'>
  <macro name='VIR_COPY_CPUMAP'
         file='libvirt-domain'
         params='cpumaps,maplen,vcpu,cpumap'
         raw='memcpy(cpumap, VIR_GET_CPUMAP(cpumaps, maplen, vcpu), maplen)'>
  ...snip...

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
scripts/apibuild.py