From a485cae819218e73bdc81e038c62f142e79901ad Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Thu, 18 Dec 2008 12:25:11 +0000 Subject: [PATCH] Replace __FUNCTION__ with __func__ for better portability (John Levon) --- ChangeLog | 6 ++++++ examples/domain-events/events-c/event-test.c | 10 +++++----- python/types.c | 4 ++-- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 814f905cea..df45adf7af 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Thu Dec 18 12:18:58 GMT 2008 Daniel P. Berrange + + * 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 Fix gcc-ism in python build (John Levon) diff --git a/examples/domain-events/events-c/event-test.c b/examples/domain-events/events-c/event-test.c index e265693f05..5272f44b86 100644 --- a/examples/domain-events/events-c/event-test.c +++ b/examples/domain-events/events-c/event-test.c @@ -11,9 +11,9 @@ #include #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); } diff --git a/python/types.c b/python/types.c index c773f3094d..7981f802ba 100644 --- a/python/types.c +++ b/python/types.c @@ -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); }