]> git.ipfire.org Git - thirdparty/libvirt.git/commit
examples: fix mingw build vs. printf
authorEric Blake <eblake@redhat.com>
Mon, 29 Jul 2013 18:53:36 +0000 (12:53 -0600)
committerEric Blake <eblake@redhat.com>
Mon, 29 Jul 2013 22:20:29 +0000 (16:20 -0600)
commitad4e7f90b4d230fa136656f59f0029bd30f0234d
treee1194d3a5c696508ef4d535faa06bf49a83443bc
parentec15df4e85bf372efdccb14c781efc1f30be5bf4
examples: fix mingw build vs. printf

Mingw *printf is a moving target; newer mingw now provides a version
of asprintf() that fails to understand %lld:

  CC       event_test-event-test.o
../../../../examples/domain-events/events-c/event-test.c: In function 'myDomainEventRTCChangeCallback':
../../../../examples/domain-events/events-c/event-test.c:270:18: error: unknown conversion type character 'l' in format [-Werror=format=]
                  virDomainGetID(dom), offset) < 0)
                  ^

But since our examples already admitted that they were hacking around
a mingw deficiency, it is easier to just use printf() directly, coupled
with <inttypes.h> macros, for a more portable work-around.

* examples/domain-events/events-c/event-test.c
(myDomainEventRTCChangeCallback): Use PRIdMAX instead of asprintf.

Signed-off-by: Eric Blake <eblake@redhat.com>
(cherry picked from commit 6f4458a017789535ee4a62fc6b5b846dec0499c9)
examples/domain-events/events-c/event-test.c