]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/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 18:53:36 +0000 (12:53 -0600)
commit6f4458a017789535ee4a62fc6b5b846dec0499c9
tree25ac114db54c346b6e6c44bbeeea43d2a1032fa7
parent93ec384b6636f7a62fce23ed0ab4023b65493480
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>
examples/domain-events/events-c/event-test.c