Came across an issue with 'list_remove' on SunOS when building vim with python, perl and/or ruby, as it conflicts with the definition found in
<sys/list.h>.

The following snippet is the error encountered (here on pkgsrc current):
gcc -c -I. -Iproto -DHAVE_CONFIG_H   -I/usr/include -I/opt/local/include 
-I/opt/local/include/ncurses  -O2 -I/usr/include -I/opt/local/include 
-I/opt/local/include/ncurses -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1       
-D_REENTRANT -O2 -pthread -I/opt/local/include -I/usr/include  
-fstack-protector -I/opt/local/include -I/usr/gnu/include -D_LARGEFILE_SOURCE 
-D_FILE_OFFSET_BITS=64 -DPERL_USE_SAFE_PUTENV  
-I/opt/local/lib/perl5/5.18.0/i386-solaris-thread-multi/CORE -o 
objects/if_perl.o auto/if_perl.c
In file included from /usr/include/sys/vnode.h:53:0,
                 from 
/var/tmp/pkgsrc/editors/vim-share/work/.buildlink/lib/perl5/5.18.0/i386-solaris-thread-multi/CORE/perl.h:1519,
                 from if_perl.xs:53:
/usr/include/sys/list.h:47:6: error: conflicting types for 'list_remove'
In file included from ./proto.h:82:0,
                 from ./vim.h:1953,
                 from if_perl.xs:38:
proto/eval.pro:62:6: note: previous declaration of 'list_remove' was here

The following patchset seems to get over this redefinition:
Index: patches/patch-eval.c
===================================================================
RCS file: patches/patch-eval.c
diff -N patches/patch-eval.c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-eval.c        3 May 2014 07:28:44 -0000
@@ -0,0 +1,40 @@
+$NetBSD$
+
+--- src/eval.c.orig    2014-01-11 21:59:11.000000000 +0000
++++ src/eval.c
+@@ -5981,7 +5981,7 @@ listitem_remove(l, item)
+     list_T  *l;
+     listitem_T *item;
+ {
+-    list_remove(l, item, item);
++    vimlist_remove(l, item, item);
+     listitem_free(item);
+ }
+
+@@ -6553,7 +6553,7 @@ list_copy(orig, deep, copyID)
+  * Does not free the listitem or the value!
+  */
+     void
+-list_remove(l, item, item2)
++vimlist_remove(l, item, item2)
+     list_T    *l;
+     listitem_T        *item;
+     listitem_T        *item2;
+@@ -15344,7 +15344,7 @@ f_remove(argvars, rettv)
+           if (argvars[2].v_type == VAR_UNKNOWN)
+           {
+               /* Remove one item, return its value. */
+-              list_remove(l, item, item);
++              vimlist_remove(l, item, item);
+               *rettv = item->li_tv;
+               vim_free(item);
+           }
+@@ -15370,7 +15370,7 @@ f_remove(argvars, rettv)
+                       EMSG(_(e_invrange));
+                   else
+                   {
+-                      list_remove(l, item, item2);
++                      vimlist_remove(l, item, item2);
+                       if (rettv_list_alloc(rettv) == OK)
+                       {
+                           l = rettv->vval.v_list;
Index: patches/patch-if__lua.c
===================================================================
RCS file: patches/patch-if__lua.c
diff -N patches/patch-if__lua.c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-if__lua.c     3 May 2014 07:28:44 -0000
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/if_lua.c.orig  2013-04-22 08:09:33.000000000 +0000
++++ src/if_lua.c
+@@ -734,7 +734,7 @@ luaV_list_newindex (lua_State *L)
+     if (li == NULL) return 0;
+     if (lua_isnil(L, 3)) /* remove? */
+     {
+-      list_remove(l, li, li);
++      vimlist_remove(l, li, li);
+       clear_tv(&li->li_tv);
+       vim_free(li);
+     }
Index: patches/patch-if__py__both.h
===================================================================
RCS file: patches/patch-if__py__both.h
diff -N patches/patch-if__py__both.h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-if__py__both.h        3 May 2014 07:28:44 -0000
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/if_py_both.h.orig      2014-01-11 21:59:11.000000000 +0000
++++ src/if_py_both.h
+@@ -2392,7 +2392,7 @@ ListAssItem(ListObject *self, Py_ssize_t
+     if (obj == NULL)
+     {
+       li = list_find(l, (long) index);
+-      list_remove(l, li, li);
++      vimlist_remove(l, li, li);
+       clear_tv(&li->li_tv);
+       vim_free(li);
+       return 0;
Index: patches/patch-proto_eval.pro
===================================================================
RCS file: patches/patch-proto_eval.pro
diff -N patches/patch-proto_eval.pro
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-proto_eval.pro        3 May 2014 07:28:44 -0000
@@ -0,0 +1,17 @@
+$NetBSD$
+
+'list_remove', being defined as well on SunOS under <sys/list.h>, causes
+a 'conflicting types' error when building with perl, python and/or ruby.
+Affects the following files: eval.c, if_lua.c and if_py_both.c
+
+--- src/proto/eval.pro.orig    2013-07-06 19:39:48.000000000 +0000
++++ src/proto/eval.pro
+@@ -59,7 +59,7 @@ int list_append_tv __ARGS((list_T *l, ty
+ int list_append_dict __ARGS((list_T *list, dict_T *dict));
+ int list_append_string __ARGS((list_T *l, char_u *str, int len));
+ int list_insert_tv __ARGS((list_T *l, typval_T *tv, listitem_T *item));
+-void list_remove __ARGS((list_T *l, listitem_T *item, listitem_T *item2));
++void vimlist_remove __ARGS((list_T *l, listitem_T *item, listitem_T *item2));
+ int garbage_collect __ARGS((void));
+ void set_ref_in_ht __ARGS((hashtab_T *ht, int copyID));
+ void set_ref_in_list __ARGS((list_T *l, int copyID));

--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui