]> rtime.felk.cvut.cz Git - ulut.git/commitdiff
Fix compilation on GCC 4.7 for ARM ABI.
authorPavel Pisa <pisa@cmp.felk.cvut.cz>
Sun, 20 Jan 2013 14:25:04 +0000 (15:25 +0100)
committerPavel Pisa <pisa@cmp.felk.cvut.cz>
Sun, 20 Jan 2013 14:25:04 +0000 (15:25 +0100)
Use va_start to initialize empty va_list properly.
The solution has quite high overhead but
other future proof portable solution has not been found.

Problem was found and initial workaround has been provided
by Martin Meloun.

Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
ulut/ul_evcbase.c

index d3884b9f1c15480ac97c0af6a56cd5f7cfb4bc5d..d2319cd9c169f0f38a7862f62baae8d0936714e7 100644 (file)
@@ -212,6 +212,19 @@ int evc_link_delete(evc_link_t *link)
   return res;
 }
 
+/* Local function to make initialization of empty va_list portable */
+static inline
+int evc_link_propagate_dead(evc_link_t *link, ...)
+{
+  va_list no_args;
+  int res;
+
+  va_start(no_args, link);
+  res=link->propagate(link,no_args);
+  va_end(no_args);
+  return res;
+}
+
 /**
  * evc_link_dispose - Disposes Link
  * @link:      pointer to the possibly connected initialized link
@@ -223,7 +236,7 @@ void evc_link_dispose(evc_link_t *link)
 {
   if(!link->dead){
     link->dead=1;
-    if(!link->propagate(link,0)){
+    if(!evc_link_propagate_dead(link)) {
       evc_link_inc_refcnt(link);
       evc_link_delete(link);
       if(link->malloced) free(link);