On Sunday, September 9, 2012 2:24:03 AM UTC+4, ZyX wrote:
> суббота, 8 сентября 2012 г., 17:34:08 UTC+4 пользователь Maxim Philippov 
> написал:
> 
> > Finally I get it =) Since vim may load libpython dynamically, 
> > PY_SSIZE_T_CLEAN doesn't do its macro magic, namely it doesn't change 
> > PyArg_ParseTuple symbol name to _PyArg_ParseTuple_SizeT (as You can see in 
> > /usr/include/python*/modsupport.h).
> 
> > 
> 
> > Now patch is a bit more complicated, please look attached 
> > py_sizet_syms.patch 
> 
> 
> 
> Wondering who is undefining PY_SSIZE_T_CLEAN on the old versions of python? 
> Currently these conditions look like "#if 1": we unconditionally define 
> PY_SSIZE_T_CLEAN before Python.h, but I don't think old Python.h or some of 
> the files included by it even knows about this macros.

Hi Zyx,

No one's undefying PY_SSIZE_T_CLEAN in Python.h. Why? =) 

There are two different functions one for int length and the other for 
Py_ssize_t. We define PY_SSIZE_T_CLEAN and that would work with implicit 
linking (through linker flags, -lpython), because preprocessor conditionally 
replaces one for the other in modsupport.h, but we need to handle that 
ourselves with explicit linking, namely dlsym _PyArg_ParseTuple_SizeT instead 
of PyArg_ParseTuple from libpython.so.

-- 
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

Raspunde prin e-mail lui