summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0867
blob: f6ff855716c49849810af91dd4c608ee6a0a1827 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0867
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 8.1.0867
Problem:    Cannot build Python interface with Python 2.4. (Tom G. Christensen)
Solution:   Define PyBytes_FromStringAndSize. (Ken Takata, closes #3888)
Files:	    src/if_python.c


*** ../vim-8.1.0866/src/if_python.c	2019-01-13 23:38:33.395773275 +0100
--- src/if_python.c	2019-02-01 22:09:15.742599161 +0100
***************
*** 73,81 ****
--- 73,83 ----
  #undef main /* Defined in python.h - aargh */
  #undef HAVE_FCNTL_H /* Clash with os_win32.h */
  
+ // Perhaps leave this out for Python 2.6, which supports bytes?
  #define PyBytes_FromString      PyString_FromString
  #define PyBytes_Check		PyString_Check
  #define PyBytes_AsStringAndSize PyString_AsStringAndSize
+ #define PyBytes_FromStringAndSize   PyString_FromStringAndSize
  
  #if !defined(FEAT_PYTHON) && defined(PROTO)
  /* Use this to be able to generate prototypes without python being used. */
***************
*** 120,129 ****
  # define PY_CAN_RECURSE
  #endif
  
! # if defined(DYNAMIC_PYTHON) || defined(PROTO)
! #  ifndef DYNAMIC_PYTHON
! #   define HINSTANCE long_u		/* for generating prototypes */
! #  endif
  
  # ifndef WIN3264
  #  include <dlfcn.h>
--- 122,131 ----
  # define PY_CAN_RECURSE
  #endif
  
! #if defined(DYNAMIC_PYTHON) || defined(PROTO)
! # ifndef DYNAMIC_PYTHON
! #  define HINSTANCE long_u		/* for generating prototypes */
! # endif
  
  # ifndef WIN3264
  #  include <dlfcn.h>
***************
*** 489,503 ****
      PYTHON_PROC *ptr;
  } python_funcname_table[] =
  {
! #ifndef PY_SSIZE_T_CLEAN
      {"PyArg_Parse", (PYTHON_PROC*)&dll_PyArg_Parse},
      {"PyArg_ParseTuple", (PYTHON_PROC*)&dll_PyArg_ParseTuple},
      {"Py_BuildValue", (PYTHON_PROC*)&dll_Py_BuildValue},
! #else
      {"_PyArg_Parse_SizeT", (PYTHON_PROC*)&dll_PyArg_Parse},
      {"_PyArg_ParseTuple_SizeT", (PYTHON_PROC*)&dll_PyArg_ParseTuple},
      {"_Py_BuildValue_SizeT", (PYTHON_PROC*)&dll_Py_BuildValue},
! #endif
      {"PyMem_Free", (PYTHON_PROC*)&dll_PyMem_Free},
      {"PyMem_Malloc", (PYTHON_PROC*)&dll_PyMem_Malloc},
      {"PyDict_SetItemString", (PYTHON_PROC*)&dll_PyDict_SetItemString},
--- 491,505 ----
      PYTHON_PROC *ptr;
  } python_funcname_table[] =
  {
! # ifndef PY_SSIZE_T_CLEAN
      {"PyArg_Parse", (PYTHON_PROC*)&dll_PyArg_Parse},
      {"PyArg_ParseTuple", (PYTHON_PROC*)&dll_PyArg_ParseTuple},
      {"Py_BuildValue", (PYTHON_PROC*)&dll_Py_BuildValue},
! # else
      {"_PyArg_Parse_SizeT", (PYTHON_PROC*)&dll_PyArg_Parse},
      {"_PyArg_ParseTuple_SizeT", (PYTHON_PROC*)&dll_PyArg_ParseTuple},
      {"_Py_BuildValue_SizeT", (PYTHON_PROC*)&dll_Py_BuildValue},
! # endif
      {"PyMem_Free", (PYTHON_PROC*)&dll_PyMem_Free},
      {"PyMem_Malloc", (PYTHON_PROC*)&dll_PyMem_Malloc},
      {"PyDict_SetItemString", (PYTHON_PROC*)&dll_PyDict_SetItemString},
***************
*** 678,684 ****
      PYTHON_PROC *ucs_as_encoded_string =
  				   (PYTHON_PROC*)&py_PyUnicode_AsEncodedString;
  
! #if !(defined(PY_NO_RTLD_GLOBAL) && defined(PY3_NO_RTLD_GLOBAL)) && defined(UNIX) && defined(FEAT_PYTHON3)
      /* Can't have Python and Python3 loaded at the same time.
       * It cause a crash, because RTLD_GLOBAL is needed for
       * standard C extension libraries of one or both python versions. */
--- 680,686 ----
      PYTHON_PROC *ucs_as_encoded_string =
  				   (PYTHON_PROC*)&py_PyUnicode_AsEncodedString;
  
! # if !(defined(PY_NO_RTLD_GLOBAL) && defined(PY3_NO_RTLD_GLOBAL)) && defined(UNIX) && defined(FEAT_PYTHON3)
      /* Can't have Python and Python3 loaded at the same time.
       * It cause a crash, because RTLD_GLOBAL is needed for
       * standard C extension libraries of one or both python versions. */
***************
*** 688,694 ****
  	    emsg(_("E836: This Vim cannot execute :python after using :py3"));
  	return FAIL;
      }
! #endif
  
      if (hinstPython)
  	return OK;
--- 690,696 ----
  	    emsg(_("E836: This Vim cannot execute :python after using :py3"));
  	return FAIL;
      }
! # endif
  
      if (hinstPython)
  	return OK;
*** ../vim-8.1.0866/src/version.c	2019-02-01 20:42:18.718884011 +0100
--- src/version.c	2019-02-01 22:09:48.697309931 +0100
***************
*** 785,786 ****
--- 785,788 ----
  {   /* Add new patch number below this line */
+ /**/
+     867,
  /**/

-- 
Vi beats Emacs to death, and then again!
			http://linuxtoday.com/stories/5764.html

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///