73
73
#undef main /* Defined in python.h - aargh */
74
74
#undef HAVE_FCNTL_H /* Clash with os_win32.h */
75
75
76
+ // Perhaps leave this out for Python 2.6, which supports bytes?
76
77
#define PyBytes_FromString PyString_FromString
77
78
#define PyBytes_Check PyString_Check
78
79
#define PyBytes_AsStringAndSize PyString_AsStringAndSize
80
+ #define PyBytes_FromStringAndSize PyString_FromStringAndSize
79
81
80
82
#if !defined(FEAT_PYTHON ) && defined(PROTO )
81
83
/* Use this to be able to generate prototypes without python being used. */
@@ -120,10 +122,10 @@ struct PyMethodDef { Py_ssize_t a; };
120
122
# define PY_CAN_RECURSE
121
123
#endif
122
124
123
- # if defined(DYNAMIC_PYTHON ) || defined(PROTO )
124
- # ifndef DYNAMIC_PYTHON
125
- # define HINSTANCE long_u /* for generating prototypes */
126
- # endif
125
+ #if defined(DYNAMIC_PYTHON ) || defined(PROTO )
126
+ # ifndef DYNAMIC_PYTHON
127
+ # define HINSTANCE long_u /* for generating prototypes */
128
+ # endif
127
129
128
130
# ifndef WIN3264
129
131
# include <dlfcn.h>
@@ -489,15 +491,15 @@ static struct
489
491
PYTHON_PROC * ptr ;
490
492
} python_funcname_table [] =
491
493
{
492
- #ifndef PY_SSIZE_T_CLEAN
494
+ # ifndef PY_SSIZE_T_CLEAN
493
495
{"PyArg_Parse" , (PYTHON_PROC * )& dll_PyArg_Parse },
494
496
{"PyArg_ParseTuple" , (PYTHON_PROC * )& dll_PyArg_ParseTuple },
495
497
{"Py_BuildValue" , (PYTHON_PROC * )& dll_Py_BuildValue },
496
- #else
498
+ # else
497
499
{"_PyArg_Parse_SizeT" , (PYTHON_PROC * )& dll_PyArg_Parse },
498
500
{"_PyArg_ParseTuple_SizeT" , (PYTHON_PROC * )& dll_PyArg_ParseTuple },
499
501
{"_Py_BuildValue_SizeT" , (PYTHON_PROC * )& dll_Py_BuildValue },
500
- #endif
502
+ # endif
501
503
{"PyMem_Free" , (PYTHON_PROC * )& dll_PyMem_Free },
502
504
{"PyMem_Malloc" , (PYTHON_PROC * )& dll_PyMem_Malloc },
503
505
{"PyDict_SetItemString" , (PYTHON_PROC * )& dll_PyDict_SetItemString },
@@ -678,7 +680,7 @@ python_runtime_link_init(char *libname, int verbose)
678
680
PYTHON_PROC * ucs_as_encoded_string =
679
681
(PYTHON_PROC * )& py_PyUnicode_AsEncodedString ;
680
682
681
- #if !(defined(PY_NO_RTLD_GLOBAL ) && defined(PY3_NO_RTLD_GLOBAL )) && defined(UNIX ) && defined(FEAT_PYTHON3 )
683
+ # if !(defined(PY_NO_RTLD_GLOBAL ) && defined(PY3_NO_RTLD_GLOBAL )) && defined(UNIX ) && defined(FEAT_PYTHON3 )
682
684
/* Can't have Python and Python3 loaded at the same time.
683
685
* It cause a crash, because RTLD_GLOBAL is needed for
684
686
* standard C extension libraries of one or both python versions. */
@@ -688,7 +690,7 @@ python_runtime_link_init(char *libname, int verbose)
688
690
emsg (_ ("E836: This Vim cannot execute :python after using :py3" ));
689
691
return FAIL ;
690
692
}
691
- #endif
693
+ # endif
692
694
693
695
if (hinstPython )
694
696
return OK ;
0 commit comments