提交 a485cae8 编写于 作者: D Daniel P. Berrange

Replace __FUNCTION__ with __func__ for better portability (John Levon)

上级 264ed020
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> Thu Dec 18 12:18:58 GMT 2008 Daniel P. Berrange <berrange@redhat.com>
Fix gcc-ism in python build (John Levon) Fix gcc-ism in python build (John Levon)
......
...@@ -11,9 +11,9 @@ ...@@ -11,9 +11,9 @@
#include <libvirt/libvirt.h> #include <libvirt/libvirt.h>
#define DEBUG0(fmt) printf("%s:%d :: " fmt "\n", \ #define DEBUG0(fmt) printf("%s:%d :: " fmt "\n", \
__FUNCTION__, __LINE__) __func__, __LINE__)
#define DEBUG(fmt, ...) printf("%s:%d: " fmt "\n", \ #define DEBUG(fmt, ...) printf("%s:%d: " fmt "\n", \
__FUNCTION__, __LINE__, __VA_ARGS__) __func__, __LINE__, __VA_ARGS__)
#define STREQ(a,b) (strcmp((a),(b)) == 0) #define STREQ(a,b) (strcmp((a),(b)) == 0)
#ifndef ATTRIBUTE_UNUSED #ifndef ATTRIBUTE_UNUSED
...@@ -158,7 +158,7 @@ int myDomainEventCallback1 (virConnectPtr conn ATTRIBUTE_UNUSED, ...@@ -158,7 +158,7 @@ int myDomainEventCallback1 (virConnectPtr conn ATTRIBUTE_UNUSED,
int detail, int detail,
void *opaque ATTRIBUTE_UNUSED) 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), virDomainGetID(dom), eventToString(event),
eventDetailToString(event, detail)); eventDetailToString(event, detail));
return 0; return 0;
...@@ -170,7 +170,7 @@ int myDomainEventCallback2 (virConnectPtr conn ATTRIBUTE_UNUSED, ...@@ -170,7 +170,7 @@ int myDomainEventCallback2 (virConnectPtr conn ATTRIBUTE_UNUSED,
int detail, int detail,
void *opaque ATTRIBUTE_UNUSED) 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), virDomainGetID(dom), eventToString(event),
eventDetailToString(event, detail)); eventDetailToString(event, detail));
return 0; return 0;
...@@ -179,7 +179,7 @@ int myDomainEventCallback2 (virConnectPtr conn ATTRIBUTE_UNUSED, ...@@ -179,7 +179,7 @@ int myDomainEventCallback2 (virConnectPtr conn ATTRIBUTE_UNUSED,
static void myFreeFunc(void *opaque) static void myFreeFunc(void *opaque)
{ {
char *str = opaque; char *str = opaque;
printf("%s: Freeing [%s]\n", __FUNCTION__, str); printf("%s: Freeing [%s]\n", __func__, str);
free(str); free(str);
} }
......
...@@ -185,7 +185,7 @@ libvirt_virEventHandleCallbackWrap(virEventHandleCallback node) ...@@ -185,7 +185,7 @@ libvirt_virEventHandleCallbackWrap(virEventHandleCallback node)
if (node == NULL) { if (node == NULL) {
Py_INCREF(Py_None); Py_INCREF(Py_None);
printf("%s: WARNING - Wrapping None\n", __FUNCTION__); printf("%s: WARNING - Wrapping None\n", __func__);
return (Py_None); return (Py_None);
} }
ret = ret =
...@@ -200,7 +200,7 @@ libvirt_virEventTimeoutCallbackWrap(virEventTimeoutCallback node) ...@@ -200,7 +200,7 @@ libvirt_virEventTimeoutCallbackWrap(virEventTimeoutCallback node)
PyObject *ret; PyObject *ret;
if (node == NULL) { if (node == NULL) {
printf("%s: WARNING - Wrapping None\n", __FUNCTION__); printf("%s: WARNING - Wrapping None\n", __func__);
Py_INCREF(Py_None); Py_INCREF(Py_None);
return (Py_None); return (Py_None);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册