Replace __FUNCTION__ with __func__ for better portability (John Levon)

This commit is contained in:
Daniel P. Berrange 2008-12-18 12:25:11 +00:00
parent 264ed02079
commit a485cae819
3 changed files with 13 additions and 7 deletions

View File

@ -1,3 +1,9 @@
Thu Dec 18 12:18:58 GMT 2008 Daniel P. Berrange <berrange@redhat.com>
* examples/domain-events/events-c/event-test.c,
python/types.c: Replace __FUNCTION__ with __func__ for
better portability (John Levon)
Thu Dec 18 12:18:58 GMT 2008 Daniel P. Berrange <berrange@redhat.com>
Fix gcc-ism in python build (John Levon)

View File

@ -11,9 +11,9 @@
#include <libvirt/libvirt.h>
#define DEBUG0(fmt) printf("%s:%d :: " fmt "\n", \
__FUNCTION__, __LINE__)
__func__, __LINE__)
#define DEBUG(fmt, ...) printf("%s:%d: " fmt "\n", \
__FUNCTION__, __LINE__, __VA_ARGS__)
__func__, __LINE__, __VA_ARGS__)
#define STREQ(a,b) (strcmp((a),(b)) == 0)
#ifndef ATTRIBUTE_UNUSED
@ -158,7 +158,7 @@ int myDomainEventCallback1 (virConnectPtr conn ATTRIBUTE_UNUSED,
int detail,
void *opaque ATTRIBUTE_UNUSED)
{
printf("%s EVENT: Domain %s(%d) %s %s\n", __FUNCTION__, virDomainGetName(dom),
printf("%s EVENT: Domain %s(%d) %s %s\n", __func__, virDomainGetName(dom),
virDomainGetID(dom), eventToString(event),
eventDetailToString(event, detail));
return 0;
@ -170,7 +170,7 @@ int myDomainEventCallback2 (virConnectPtr conn ATTRIBUTE_UNUSED,
int detail,
void *opaque ATTRIBUTE_UNUSED)
{
printf("%s EVENT: Domain %s(%d) %s %s\n", __FUNCTION__, virDomainGetName(dom),
printf("%s EVENT: Domain %s(%d) %s %s\n", __func__, virDomainGetName(dom),
virDomainGetID(dom), eventToString(event),
eventDetailToString(event, detail));
return 0;
@ -179,7 +179,7 @@ int myDomainEventCallback2 (virConnectPtr conn ATTRIBUTE_UNUSED,
static void myFreeFunc(void *opaque)
{
char *str = opaque;
printf("%s: Freeing [%s]\n", __FUNCTION__, str);
printf("%s: Freeing [%s]\n", __func__, str);
free(str);
}

View File

@ -185,7 +185,7 @@ libvirt_virEventHandleCallbackWrap(virEventHandleCallback node)
if (node == NULL) {
Py_INCREF(Py_None);
printf("%s: WARNING - Wrapping None\n", __FUNCTION__);
printf("%s: WARNING - Wrapping None\n", __func__);
return (Py_None);
}
ret =
@ -200,7 +200,7 @@ libvirt_virEventTimeoutCallbackWrap(virEventTimeoutCallback node)
PyObject *ret;
if (node == NULL) {
printf("%s: WARNING - Wrapping None\n", __FUNCTION__);
printf("%s: WARNING - Wrapping None\n", __func__);
Py_INCREF(Py_None);
return (Py_None);
}