[gtk-vnc-devel] [patch] yeild conflict with /usr/include/unistd.h on Solaris



Hi there,

Hope you've seen my previous three patches, this is the last one I have
by now. :)

This time is very simple, there is already a function called yeild on
in /usr/include/unistd.h,
$cat /usr/include/unistd.h|grep yield
extern void yield(void);
extern void yield();

They are different with yeild defined in coroutine.h
$cat src/coroutine.h|grep yield
void *yieldto(struct coroutine *to, void *arg);
void *yield(void *arg);

That's cause build fail.


My patch rename the yield to gvnc_yield, which is based the idea adding
namespace to those possible conflict function. Hope you can accept it.

Thanks,
Halton.
diff -r d6f1a50dbb0b src/coroutine.c
--- a/src/coroutine.c	Sun Oct 21 17:11:07 2007 -0300
+++ b/src/coroutine.c	Thu Oct 25 22:52:12 2007 +0800
@@ -102,7 +102,7 @@ void *yieldto(struct coroutine *to, void
 	return coroutine_swap(coroutine_self(), to, arg);
 }
 
-void *yield(void *arg)
+void *gvnc_yield(void *arg)
 {
 	struct coroutine *to = coroutine_self()->caller;
 	if (!to) {
diff -r d6f1a50dbb0b src/coroutine.h
--- a/src/coroutine.h	Sun Oct 21 17:11:07 2007 -0300
+++ b/src/coroutine.h	Thu Oct 25 22:51:59 2007 +0800
@@ -39,7 +39,7 @@ struct coroutine *coroutine_self(void);
 
 void *yieldto(struct coroutine *to, void *arg);
 
-void *yield(void *arg);
+void *gvnc_yield(void *arg);
 
 #endif
 /*
diff -r d6f1a50dbb0b src/gvnc.c
--- a/src/gvnc.c	Sun Oct 21 17:11:07 2007 -0300
+++ b/src/gvnc.c	Thu Oct 25 22:51:36 2007 +0800
@@ -144,7 +144,7 @@ static GIOCondition g_io_wait(GIOChannel
 	GIOCondition *ret;
 
 	g_io_add_watch(channel, cond | G_IO_HUP | G_IO_ERR | G_IO_NVAL, g_io_wait_helper, coroutine_self());
-	ret = yield(NULL);
+	ret = gvnc_yield(NULL);
 
 	return *ret;
 }
@@ -161,7 +161,7 @@ static GIOCondition g_io_wait_interrupta
 	id = g_io_add_watch(channel, cond | G_IO_HUP | G_IO_ERR | G_IO_NVAL, g_io_wait_helper, wait->context);
 
 	wait->waiting = TRUE;
-	ret = yield(NULL);
+	ret = gvnc_yield(NULL);
 	wait->waiting = FALSE;
 
 	if (ret == NULL) {
@@ -240,7 +240,7 @@ static gboolean g_condition_wait(g_condi
 
 	g_source_attach(src, NULL);
 	g_source_set_callback(src, g_condition_wait_helper, coroutine_self(), NULL);
-	yield(NULL);
+	gvnc_yield(NULL);
 	return TRUE;
 }
 
diff -r d6f1a50dbb0b src/libgtk-vnc_sym.version
--- a/src/libgtk-vnc_sym.version	Sun Oct 21 17:11:07 2007 -0300
+++ b/src/libgtk-vnc_sym.version	Thu Oct 25 22:55:26 2007 +0800
@@ -59,7 +59,7 @@
     coroutine_swap;
     coroutine_self;
     yieldto;
-    yield;
+    gvnc_yield;
 
   local:
       *;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]