# HG changeset patch # User Steve Dower # Date 1482787707 28800 # Mon Dec 26 13:28:27 2016 -0800 # Branch 3.6 # Node ID 8424d4aa6c7f8ccfd3baefbdea1c11a5514c1dd4 # Parent 02acb2f9c908d01a851db8a4115be06c066b0694 Issue #23903: Regenerate python3.def on build diff --git a/Include/modsupport.h b/Include/modsupport.h --- a/Include/modsupport.h +++ b/Include/modsupport.h @@ -41,11 +41,11 @@ #ifndef Py_LIMITED_API PyAPI_FUNC(int) _PyArg_NoKeywords(const char *funcname, PyObject *kw); PyAPI_FUNC(int) _PyArg_NoPositional(const char *funcname, PyObject *args); +#endif PyAPI_FUNC(int) PyArg_VaParse(PyObject *, const char *, va_list); PyAPI_FUNC(int) PyArg_VaParseTupleAndKeywords(PyObject *, PyObject *, const char *, char **, va_list); -#endif PyAPI_FUNC(PyObject *) Py_VaBuildValue(const char *, va_list); #ifndef Py_LIMITED_API diff --git a/Include/odictobject.h b/Include/odictobject.h --- a/Include/odictobject.h +++ b/Include/odictobject.h @@ -11,7 +11,6 @@ typedef struct _odictobject PyODictObject; -PyAPI_DATA(PyTypeObject) PyODict_Type; PyAPI_DATA(PyTypeObject) PyODictIter_Type; PyAPI_DATA(PyTypeObject) PyODictKeys_Type; PyAPI_DATA(PyTypeObject) PyODictItems_Type; @@ -19,6 +18,8 @@ #endif /* Py_LIMITED_API */ +PyAPI_DATA(PyTypeObject) PyODict_Type; + #define PyODict_Check(op) PyObject_TypeCheck(op, &PyODict_Type) #define PyODict_CheckExact(op) (Py_TYPE(op) == &PyODict_Type) #define PyODict_SIZE(op) ((PyDictObject *)op)->ma_used diff --git a/Include/pythonrun.h b/Include/pythonrun.h --- a/Include/pythonrun.h +++ b/Include/pythonrun.h @@ -169,7 +169,7 @@ PyAPI_FUNC(char *) PyOS_Readline(FILE *, FILE *, const char *); #endif PyAPI_DATA(int) (*PyOS_InputHook)(void); -PyAPI_DATA(char) *(*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, const char *); +PyAPI_DATA(char *) (*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, const char *); #ifndef Py_LIMITED_API PyAPI_DATA(PyThreadState*) _PyOS_ReadlineTState; #endif diff --git a/PC/python3.def b/PC/python3.def --- a/PC/python3.def +++ b/PC/python3.def @@ -39,7 +39,6 @@ PyCFunction_GetFlags=python36.PyCFunction_GetFlags PyCFunction_GetFunction=python36.PyCFunction_GetFunction PyCFunction_GetSelf=python36.PyCFunction_GetSelf - PyCFunction_New=python36.PyCFunction_New PyCFunction_NewEx=python36.PyCFunction_NewEx PyCFunction_Type=python36.PyCFunction_Type DATA PyCallIter_New=python36.PyCallIter_New @@ -58,6 +57,7 @@ PyCapsule_SetPointer=python36.PyCapsule_SetPointer PyCapsule_Type=python36.PyCapsule_Type DATA PyClassMethodDescr_Type=python36.PyClassMethodDescr_Type DATA + PyCmpWrapper_Type=python36.PyCmpWrapper_Type DATA PyCodec_BackslashReplaceErrors=python36.PyCodec_BackslashReplaceErrors PyCodec_Decode=python36.PyCodec_Decode PyCodec_Decoder=python36.PyCodec_Decoder @@ -68,6 +68,7 @@ PyCodec_IncrementalEncoder=python36.PyCodec_IncrementalEncoder PyCodec_KnownEncoding=python36.PyCodec_KnownEncoding PyCodec_LookupError=python36.PyCodec_LookupError + PyCodec_NameReplaceErrors=python36.PyCodec_NameReplaceErrors PyCodec_Register=python36.PyCodec_Register PyCodec_RegisterError=python36.PyCodec_RegisterError PyCodec_ReplaceErrors=python36.PyCodec_ReplaceErrors @@ -122,6 +123,7 @@ PyErr_Fetch=python36.PyErr_Fetch PyErr_Format=python36.PyErr_Format PyErr_FormatV=python36.PyErr_FormatV + PyErr_GetExcInfo=python36.PyErr_GetExcInfo PyErr_GivenExceptionMatches=python36.PyErr_GivenExceptionMatches PyErr_NewException=python36.PyErr_NewException PyErr_NewExceptionWithDoc=python36.PyErr_NewExceptionWithDoc @@ -131,15 +133,28 @@ PyErr_Print=python36.PyErr_Print PyErr_PrintEx=python36.PyErr_PrintEx PyErr_ProgramText=python36.PyErr_ProgramText + PyErr_ResourceWarning=python36.PyErr_ResourceWarning PyErr_Restore=python36.PyErr_Restore + PyErr_SetExcFromWindowsErr=python36.PyErr_SetExcFromWindowsErr + PyErr_SetExcFromWindowsErrWithFilename=python36.PyErr_SetExcFromWindowsErrWithFilename + PyErr_SetExcFromWindowsErrWithFilenameObject=python36.PyErr_SetExcFromWindowsErrWithFilenameObject + PyErr_SetExcFromWindowsErrWithFilenameObjects=python36.PyErr_SetExcFromWindowsErrWithFilenameObjects + PyErr_SetExcInfo=python36.PyErr_SetExcInfo + PyErr_SetExcWithArgsKwargs=python36.PyErr_SetExcWithArgsKwargs PyErr_SetFromErrno=python36.PyErr_SetFromErrno PyErr_SetFromErrnoWithFilename=python36.PyErr_SetFromErrnoWithFilename PyErr_SetFromErrnoWithFilenameObject=python36.PyErr_SetFromErrnoWithFilenameObject + PyErr_SetFromErrnoWithFilenameObjects=python36.PyErr_SetFromErrnoWithFilenameObjects + PyErr_SetFromWindowsErr=python36.PyErr_SetFromWindowsErr + PyErr_SetFromWindowsErrWithFilename=python36.PyErr_SetFromWindowsErrWithFilename + PyErr_SetImportError=python36.PyErr_SetImportError + PyErr_SetImportErrorSubclass=python36.PyErr_SetImportErrorSubclass PyErr_SetInterrupt=python36.PyErr_SetInterrupt PyErr_SetNone=python36.PyErr_SetNone PyErr_SetObject=python36.PyErr_SetObject PyErr_SetString=python36.PyErr_SetString PyErr_SyntaxLocation=python36.PyErr_SyntaxLocation + PyErr_SyntaxLocationEx=python36.PyErr_SyntaxLocationEx PyErr_WarnEx=python36.PyErr_WarnEx PyErr_WarnExplicit=python36.PyErr_WarnExplicit PyErr_WarnFormat=python36.PyErr_WarnFormat @@ -167,16 +182,31 @@ PyEval_RestoreThread=python36.PyEval_RestoreThread PyEval_SaveThread=python36.PyEval_SaveThread PyEval_ThreadsInitialized=python36.PyEval_ThreadsInitialized + PyException_GetCause=python36.PyException_GetCause + PyException_GetContext=python36.PyException_GetContext + PyException_GetTraceback=python36.PyException_GetTraceback + PyException_SetCause=python36.PyException_SetCause + PyException_SetContext=python36.PyException_SetContext + PyException_SetTraceback=python36.PyException_SetTraceback PyExc_ArithmeticError=python36.PyExc_ArithmeticError DATA PyExc_AssertionError=python36.PyExc_AssertionError DATA PyExc_AttributeError=python36.PyExc_AttributeError DATA PyExc_BaseException=python36.PyExc_BaseException DATA + PyExc_BlockingIOError=python36.PyExc_BlockingIOError DATA + PyExc_BrokenPipeError=python36.PyExc_BrokenPipeError DATA PyExc_BufferError=python36.PyExc_BufferError DATA PyExc_BytesWarning=python36.PyExc_BytesWarning DATA + PyExc_ChildProcessError=python36.PyExc_ChildProcessError DATA + PyExc_ConnectionAbortedError=python36.PyExc_ConnectionAbortedError DATA + PyExc_ConnectionError=python36.PyExc_ConnectionError DATA + PyExc_ConnectionRefusedError=python36.PyExc_ConnectionRefusedError DATA + PyExc_ConnectionResetError=python36.PyExc_ConnectionResetError DATA PyExc_DeprecationWarning=python36.PyExc_DeprecationWarning DATA PyExc_EOFError=python36.PyExc_EOFError DATA PyExc_EnvironmentError=python36.PyExc_EnvironmentError DATA PyExc_Exception=python36.PyExc_Exception DATA + PyExc_FileExistsError=python36.PyExc_FileExistsError DATA + PyExc_FileNotFoundError=python36.PyExc_FileNotFoundError DATA PyExc_FloatingPointError=python36.PyExc_FloatingPointError DATA PyExc_FutureWarning=python36.PyExc_FutureWarning DATA PyExc_GeneratorExit=python36.PyExc_GeneratorExit DATA @@ -185,26 +215,35 @@ PyExc_ImportWarning=python36.PyExc_ImportWarning DATA PyExc_IndentationError=python36.PyExc_IndentationError DATA PyExc_IndexError=python36.PyExc_IndexError DATA + PyExc_InterruptedError=python36.PyExc_InterruptedError DATA + PyExc_IsADirectoryError=python36.PyExc_IsADirectoryError DATA PyExc_KeyError=python36.PyExc_KeyError DATA PyExc_KeyboardInterrupt=python36.PyExc_KeyboardInterrupt DATA PyExc_LookupError=python36.PyExc_LookupError DATA PyExc_MemoryError=python36.PyExc_MemoryError DATA - PyExc_MemoryErrorInst=python36.PyExc_MemoryErrorInst DATA + PyExc_ModuleNotFoundError=python36.PyExc_ModuleNotFoundError DATA PyExc_NameError=python36.PyExc_NameError DATA + PyExc_NotADirectoryError=python36.PyExc_NotADirectoryError DATA PyExc_NotImplementedError=python36.PyExc_NotImplementedError DATA PyExc_OSError=python36.PyExc_OSError DATA PyExc_OverflowError=python36.PyExc_OverflowError DATA PyExc_PendingDeprecationWarning=python36.PyExc_PendingDeprecationWarning DATA + PyExc_PermissionError=python36.PyExc_PermissionError DATA + PyExc_ProcessLookupError=python36.PyExc_ProcessLookupError DATA + PyExc_RecursionError=python36.PyExc_RecursionError DATA PyExc_RecursionErrorInst=python36.PyExc_RecursionErrorInst DATA PyExc_ReferenceError=python36.PyExc_ReferenceError DATA + PyExc_ResourceWarning=python36.PyExc_ResourceWarning DATA PyExc_RuntimeError=python36.PyExc_RuntimeError DATA PyExc_RuntimeWarning=python36.PyExc_RuntimeWarning DATA + PyExc_StopAsyncIteration=python36.PyExc_StopAsyncIteration DATA PyExc_StopIteration=python36.PyExc_StopIteration DATA PyExc_SyntaxError=python36.PyExc_SyntaxError DATA PyExc_SyntaxWarning=python36.PyExc_SyntaxWarning DATA PyExc_SystemError=python36.PyExc_SystemError DATA PyExc_SystemExit=python36.PyExc_SystemExit DATA PyExc_TabError=python36.PyExc_TabError DATA + PyExc_TimeoutError=python36.PyExc_TimeoutError DATA PyExc_TypeError=python36.PyExc_TypeError DATA PyExc_UnboundLocalError=python36.PyExc_UnboundLocalError DATA PyExc_UnicodeDecodeError=python36.PyExc_UnicodeDecodeError DATA @@ -215,13 +254,8 @@ PyExc_UserWarning=python36.PyExc_UserWarning DATA PyExc_ValueError=python36.PyExc_ValueError DATA PyExc_Warning=python36.PyExc_Warning DATA + PyExc_WindowsError=python36.PyExc_WindowsError DATA PyExc_ZeroDivisionError=python36.PyExc_ZeroDivisionError DATA - PyException_GetCause=python36.PyException_GetCause - PyException_GetContext=python36.PyException_GetContext - PyException_GetTraceback=python36.PyException_GetTraceback - PyException_SetCause=python36.PyException_SetCause - PyException_SetContext=python36.PyException_SetContext - PyException_SetTraceback=python36.PyException_SetTraceback PyFile_FromFd=python36.PyFile_FromFd PyFile_GetLine=python36.PyFile_GetLine PyFile_WriteObject=python36.PyFile_WriteObject @@ -242,10 +276,12 @@ PyGILState_Release=python36.PyGILState_Release PyGetSetDescr_Type=python36.PyGetSetDescr_Type DATA PyImport_AddModule=python36.PyImport_AddModule + PyImport_AddModuleObject=python36.PyImport_AddModuleObject PyImport_AppendInittab=python36.PyImport_AppendInittab PyImport_Cleanup=python36.PyImport_Cleanup PyImport_ExecCodeModule=python36.PyImport_ExecCodeModule PyImport_ExecCodeModuleEx=python36.PyImport_ExecCodeModuleEx + PyImport_ExecCodeModuleObject=python36.PyImport_ExecCodeModuleObject PyImport_ExecCodeModuleWithPathnames=python36.PyImport_ExecCodeModuleWithPathnames PyImport_GetImporter=python36.PyImport_GetImporter PyImport_GetMagicNumber=python36.PyImport_GetMagicNumber @@ -253,8 +289,10 @@ PyImport_GetModuleDict=python36.PyImport_GetModuleDict PyImport_Import=python36.PyImport_Import PyImport_ImportFrozenModule=python36.PyImport_ImportFrozenModule + PyImport_ImportFrozenModuleObject=python36.PyImport_ImportFrozenModuleObject PyImport_ImportModule=python36.PyImport_ImportModule PyImport_ImportModuleLevel=python36.PyImport_ImportModuleLevel + PyImport_ImportModuleLevelObject=python36.PyImport_ImportModuleLevelObject PyImport_ImportModuleNoBlock=python36.PyImport_ImportModuleNoBlock PyImport_ReloadModule=python36.PyImport_ReloadModule PyInterpreterState_Clear=python36.PyInterpreterState_Clear @@ -299,7 +337,6 @@ PyLong_FromVoidPtr=python36.PyLong_FromVoidPtr PyLong_GetInfo=python36.PyLong_GetInfo PyLong_Type=python36.PyLong_Type DATA - PyMap_Type=python36.PyMap_Type DATA PyMapping_Check=python36.PyMapping_Check PyMapping_GetItemString=python36.PyMapping_GetItemString PyMapping_HasKey=python36.PyMapping_HasKey @@ -310,27 +347,36 @@ PyMapping_SetItemString=python36.PyMapping_SetItemString PyMapping_Size=python36.PyMapping_Size PyMapping_Values=python36.PyMapping_Values + PyMap_Type=python36.PyMap_Type DATA + PyMemberDescr_Type=python36.PyMemberDescr_Type DATA + PyMemoryView_FromMemory=python36.PyMemoryView_FromMemory + PyMemoryView_FromObject=python36.PyMemoryView_FromObject + PyMemoryView_GetContiguous=python36.PyMemoryView_GetContiguous + PyMemoryView_Type=python36.PyMemoryView_Type DATA + PyMem_Calloc=python36.PyMem_Calloc PyMem_Free=python36.PyMem_Free PyMem_Malloc=python36.PyMem_Malloc PyMem_Realloc=python36.PyMem_Realloc - PyMemberDescr_Type=python36.PyMemberDescr_Type DATA - PyMemoryView_FromObject=python36.PyMemoryView_FromObject - PyMemoryView_GetContiguous=python36.PyMemoryView_GetContiguous - PyMemoryView_Type=python36.PyMemoryView_Type DATA PyMethodDescr_Type=python36.PyMethodDescr_Type DATA PyModuleDef_Init=python36.PyModuleDef_Init PyModuleDef_Type=python36.PyModuleDef_Type DATA + PyModule_AddFunctions=python36.PyModule_AddFunctions PyModule_AddIntConstant=python36.PyModule_AddIntConstant PyModule_AddObject=python36.PyModule_AddObject PyModule_AddStringConstant=python36.PyModule_AddStringConstant PyModule_Create2=python36.PyModule_Create2 + PyModule_ExecDef=python36.PyModule_ExecDef + PyModule_FromDefAndSpec2=python36.PyModule_FromDefAndSpec2 PyModule_GetDef=python36.PyModule_GetDef PyModule_GetDict=python36.PyModule_GetDict PyModule_GetFilename=python36.PyModule_GetFilename PyModule_GetFilenameObject=python36.PyModule_GetFilenameObject PyModule_GetName=python36.PyModule_GetName + PyModule_GetNameObject=python36.PyModule_GetNameObject PyModule_GetState=python36.PyModule_GetState PyModule_New=python36.PyModule_New + PyModule_NewObject=python36.PyModule_NewObject + PyModule_SetDocString=python36.PyModule_SetDocString PyModule_Type=python36.PyModule_Type DATA PyNullImporter_Type=python36.PyNullImporter_Type DATA PyNumber_Absolute=python36.PyNumber_Absolute @@ -345,6 +391,7 @@ PyNumber_InPlaceAnd=python36.PyNumber_InPlaceAnd PyNumber_InPlaceFloorDivide=python36.PyNumber_InPlaceFloorDivide PyNumber_InPlaceLshift=python36.PyNumber_InPlaceLshift + PyNumber_InPlaceMatrixMultiply=python36.PyNumber_InPlaceMatrixMultiply PyNumber_InPlaceMultiply=python36.PyNumber_InPlaceMultiply PyNumber_InPlaceOr=python36.PyNumber_InPlaceOr PyNumber_InPlacePower=python36.PyNumber_InPlacePower @@ -357,6 +404,7 @@ PyNumber_Invert=python36.PyNumber_Invert PyNumber_Long=python36.PyNumber_Long PyNumber_Lshift=python36.PyNumber_Lshift + PyNumber_MatrixMultiply=python36.PyNumber_MatrixMultiply PyNumber_Multiply=python36.PyNumber_Multiply PyNumber_Negative=python36.PyNumber_Negative PyNumber_Or=python36.PyNumber_Or @@ -368,15 +416,13 @@ PyNumber_ToBase=python36.PyNumber_ToBase PyNumber_TrueDivide=python36.PyNumber_TrueDivide PyNumber_Xor=python36.PyNumber_Xor - PyODictItems_Type=python36.PyODictItems_Type DATA - PyODictIter_Type=python36.PyODictIter_Type DATA - PyODictKeys_Type=python36.PyODictKeys_Type DATA - PyODictValues_Type=python36.PyODictValues_Type DATA PyODict_DelItem=python36.PyODict_DelItem PyODict_New=python36.PyODict_New PyODict_SetItem=python36.PyODict_SetItem PyODict_Type=python36.PyODict_Type DATA PyOS_AfterFork=python36.PyOS_AfterFork + PyOS_CheckStack=python36.PyOS_CheckStack + PyOS_FSPath=python36.PyOS_FSPath PyOS_InitInterrupts=python36.PyOS_InitInterrupts PyOS_InputHook=python36.PyOS_InputHook DATA PyOS_InterruptOccurred=python36.PyOS_InterruptOccurred @@ -403,6 +449,7 @@ PyObject_CallMethod=python36.PyObject_CallMethod PyObject_CallMethodObjArgs=python36.PyObject_CallMethodObjArgs PyObject_CallObject=python36.PyObject_CallObject + PyObject_Calloc=python36.PyObject_Calloc PyObject_CheckReadBuffer=python36.PyObject_CheckReadBuffer PyObject_ClearWeakRefs=python36.PyObject_ClearWeakRefs PyObject_DelItem=python36.PyObject_DelItem @@ -415,6 +462,7 @@ PyObject_GC_UnTrack=python36.PyObject_GC_UnTrack PyObject_GenericGetAttr=python36.PyObject_GenericGetAttr PyObject_GenericSetAttr=python36.PyObject_GenericSetAttr + PyObject_GenericSetDict=python36.PyObject_GenericSetDict PyObject_GetAttr=python36.PyObject_GetAttr PyObject_GetAttrString=python36.PyObject_GetAttrString PyObject_GetItem=python36.PyObject_GetItem @@ -441,9 +489,10 @@ PyObject_SetItem=python36.PyObject_SetItem PyObject_Size=python36.PyObject_Size PyObject_Str=python36.PyObject_Str - PyObject_Type=python36.PyObject_Type DATA + PyObject_Type=python36.PyObject_Type PyParser_SimpleParseFileFlags=python36.PyParser_SimpleParseFileFlags PyParser_SimpleParseStringFlags=python36.PyParser_SimpleParseStringFlags + PyParser_SimpleParseStringFlagsFilename=python36.PyParser_SimpleParseStringFlagsFilename PyProperty_Type=python36.PyProperty_Type DATA PyRangeIter_Type=python36.PyRangeIter_Type DATA PyRange_Type=python36.PyRange_Type DATA @@ -494,9 +543,11 @@ PySuper_Type=python36.PySuper_Type DATA PySys_AddWarnOption=python36.PySys_AddWarnOption PySys_AddWarnOptionUnicode=python36.PySys_AddWarnOptionUnicode + PySys_AddXOption=python36.PySys_AddXOption PySys_FormatStderr=python36.PySys_FormatStderr PySys_FormatStdout=python36.PySys_FormatStdout PySys_GetObject=python36.PySys_GetObject + PySys_GetXOptions=python36.PySys_GetXOptions PySys_HasWarnOptions=python36.PySys_HasWarnOptions PySys_ResetWarnOptions=python36.PySys_ResetWarnOptions PySys_SetArgv=python36.PySys_SetArgv @@ -571,14 +622,18 @@ PyUnicode_AsEncodedString=python36.PyUnicode_AsEncodedString PyUnicode_AsEncodedUnicode=python36.PyUnicode_AsEncodedUnicode PyUnicode_AsLatin1String=python36.PyUnicode_AsLatin1String + PyUnicode_AsMBCSString=python36.PyUnicode_AsMBCSString PyUnicode_AsRawUnicodeEscapeString=python36.PyUnicode_AsRawUnicodeEscapeString + PyUnicode_AsUCS4=python36.PyUnicode_AsUCS4 + PyUnicode_AsUCS4Copy=python36.PyUnicode_AsUCS4Copy PyUnicode_AsUTF16String=python36.PyUnicode_AsUTF16String PyUnicode_AsUTF32String=python36.PyUnicode_AsUTF32String PyUnicode_AsUTF8String=python36.PyUnicode_AsUTF8String PyUnicode_AsUnicodeEscapeString=python36.PyUnicode_AsUnicodeEscapeString PyUnicode_AsWideChar=python36.PyUnicode_AsWideChar + PyUnicode_AsWideCharString=python36.PyUnicode_AsWideCharString PyUnicode_BuildEncodingMap=python36.PyUnicode_BuildEncodingMap - PyUnicode_ClearFreelist=python36.PyUnicode_ClearFreelist + PyUnicode_ClearFreeList=python36.PyUnicode_ClearFreeList PyUnicode_Compare=python36.PyUnicode_Compare PyUnicode_CompareWithASCIIString=python36.PyUnicode_CompareWithASCIIString PyUnicode_Concat=python36.PyUnicode_Concat @@ -587,9 +642,14 @@ PyUnicode_Decode=python36.PyUnicode_Decode PyUnicode_DecodeASCII=python36.PyUnicode_DecodeASCII PyUnicode_DecodeCharmap=python36.PyUnicode_DecodeCharmap + PyUnicode_DecodeCodePageStateful=python36.PyUnicode_DecodeCodePageStateful PyUnicode_DecodeFSDefault=python36.PyUnicode_DecodeFSDefault PyUnicode_DecodeFSDefaultAndSize=python36.PyUnicode_DecodeFSDefaultAndSize PyUnicode_DecodeLatin1=python36.PyUnicode_DecodeLatin1 + PyUnicode_DecodeLocale=python36.PyUnicode_DecodeLocale + PyUnicode_DecodeLocaleAndSize=python36.PyUnicode_DecodeLocaleAndSize + PyUnicode_DecodeMBCS=python36.PyUnicode_DecodeMBCS + PyUnicode_DecodeMBCSStateful=python36.PyUnicode_DecodeMBCSStateful PyUnicode_DecodeRawUnicodeEscape=python36.PyUnicode_DecodeRawUnicodeEscape PyUnicode_DecodeUTF16=python36.PyUnicode_DecodeUTF16 PyUnicode_DecodeUTF16Stateful=python36.PyUnicode_DecodeUTF16Stateful @@ -600,10 +660,13 @@ PyUnicode_DecodeUTF8=python36.PyUnicode_DecodeUTF8 PyUnicode_DecodeUTF8Stateful=python36.PyUnicode_DecodeUTF8Stateful PyUnicode_DecodeUnicodeEscape=python36.PyUnicode_DecodeUnicodeEscape + PyUnicode_EncodeCodePage=python36.PyUnicode_EncodeCodePage PyUnicode_EncodeFSDefault=python36.PyUnicode_EncodeFSDefault + PyUnicode_EncodeLocale=python36.PyUnicode_EncodeLocale PyUnicode_FSConverter=python36.PyUnicode_FSConverter PyUnicode_FSDecoder=python36.PyUnicode_FSDecoder PyUnicode_Find=python36.PyUnicode_Find + PyUnicode_FindChar=python36.PyUnicode_FindChar PyUnicode_Format=python36.PyUnicode_Format PyUnicode_FromEncodedObject=python36.PyUnicode_FromEncodedObject PyUnicode_FromFormat=python36.PyUnicode_FromFormat @@ -614,6 +677,7 @@ PyUnicode_FromStringAndSize=python36.PyUnicode_FromStringAndSize PyUnicode_FromWideChar=python36.PyUnicode_FromWideChar PyUnicode_GetDefaultEncoding=python36.PyUnicode_GetDefaultEncoding + PyUnicode_GetLength=python36.PyUnicode_GetLength PyUnicode_GetSize=python36.PyUnicode_GetSize PyUnicode_InternFromString=python36.PyUnicode_InternFromString PyUnicode_InternImmortal=python36.PyUnicode_InternImmortal @@ -623,16 +687,18 @@ PyUnicode_Partition=python36.PyUnicode_Partition PyUnicode_RPartition=python36.PyUnicode_RPartition PyUnicode_RSplit=python36.PyUnicode_RSplit + PyUnicode_ReadChar=python36.PyUnicode_ReadChar PyUnicode_Replace=python36.PyUnicode_Replace PyUnicode_Resize=python36.PyUnicode_Resize PyUnicode_RichCompare=python36.PyUnicode_RichCompare - PyUnicode_SetDefaultEncoding=python36.PyUnicode_SetDefaultEncoding PyUnicode_Split=python36.PyUnicode_Split PyUnicode_Splitlines=python36.PyUnicode_Splitlines + PyUnicode_Substring=python36.PyUnicode_Substring PyUnicode_Tailmatch=python36.PyUnicode_Tailmatch PyUnicode_Translate=python36.PyUnicode_Translate PyUnicode_Type=python36.PyUnicode_Type DATA - PyWeakref_GetObject=python36.PyWeakref_GetObject DATA + PyUnicode_WriteChar=python36.PyUnicode_WriteChar + PyWeakref_GetObject=python36.PyWeakref_GetObject PyWeakref_NewProxy=python36.PyWeakref_NewProxy PyWeakref_NewRef=python36.PyWeakref_NewRef PyWrapperDescr_Type=python36.PyWrapperDescr_Type DATA @@ -643,9 +709,12 @@ Py_BuildValue=python36.Py_BuildValue Py_CompileString=python36.Py_CompileString Py_DecRef=python36.Py_DecRef + Py_DecodeLocale=python36.Py_DecodeLocale + Py_EncodeLocale=python36.Py_EncodeLocale Py_EndInterpreter=python36.Py_EndInterpreter Py_Exit=python36.Py_Exit Py_FatalError=python36.Py_FatalError + Py_FileSystemDefaultEncodeErrors=python36.Py_FileSystemDefaultEncodeErrors DATA Py_FileSystemDefaultEncoding=python36.Py_FileSystemDefaultEncoding DATA Py_Finalize=python36.Py_Finalize Py_FinalizeEx=python36.Py_FinalizeEx @@ -671,32 +740,25 @@ Py_NewInterpreter=python36.Py_NewInterpreter Py_ReprEnter=python36.Py_ReprEnter Py_ReprLeave=python36.Py_ReprLeave + Py_SetPath=python36.Py_SetPath Py_SetProgramName=python36.Py_SetProgramName Py_SetPythonHome=python36.Py_SetPythonHome Py_SetRecursionLimit=python36.Py_SetRecursionLimit Py_SymtableString=python36.Py_SymtableString Py_VaBuildValue=python36.Py_VaBuildValue - _PyArg_ParseTupleAndKeywords_SizeT=python36._PyArg_ParseTupleAndKeywords_SizeT - _PyArg_ParseTuple_SizeT=python36._PyArg_ParseTuple_SizeT - _PyArg_Parse_SizeT=python36._PyArg_Parse_SizeT - _PyArg_VaParseTupleAndKeywords_SizeT=python36._PyArg_VaParseTupleAndKeywords_SizeT - _PyArg_VaParse_SizeT=python36._PyArg_VaParse_SizeT + Py_hexdigits=python36.Py_hexdigits DATA + _PyBytes_DecodeEscape=python36._PyBytes_DecodeEscape _PyErr_BadInternalCall=python36._PyErr_BadInternalCall _PyObject_CallFunction_SizeT=python36._PyObject_CallFunction_SizeT _PyObject_CallMethod_SizeT=python36._PyObject_CallMethod_SizeT - _PyObject_GC_Malloc=python36._PyObject_GC_Malloc _PyObject_GC_New=python36._PyObject_GC_New _PyObject_GC_NewVar=python36._PyObject_GC_NewVar _PyObject_GC_Resize=python36._PyObject_GC_Resize _PyObject_New=python36._PyObject_New _PyObject_NewVar=python36._PyObject_NewVar - _PyState_AddModule=python36._PyState_AddModule - _PyThreadState_Init=python36._PyThreadState_Init - _PyThreadState_Prealloc=python36._PyThreadState_Prealloc - _PyTrash_delete_later=python36._PyTrash_delete_later DATA - _PyTrash_delete_nesting=python36._PyTrash_delete_nesting DATA - _PyTrash_deposit_object=python36._PyTrash_deposit_object - _PyTrash_destroy_chain=python36._PyTrash_destroy_chain + _PyTrash_thread_deposit_object=python36._PyTrash_thread_deposit_object + _PyTrash_thread_destroy_chain=python36._PyTrash_thread_destroy_chain + _PyUnicode_DecodeUnicodeEscape=python36._PyUnicode_DecodeUnicodeEscape _PyWeakref_CallableProxyType=python36._PyWeakref_CallableProxyType DATA _PyWeakref_ProxyType=python36._PyWeakref_ProxyType DATA _PyWeakref_RefType=python36._PyWeakref_RefType DATA @@ -708,6 +770,3 @@ _Py_FalseStruct=python36._Py_FalseStruct DATA _Py_NoneStruct=python36._Py_NoneStruct DATA _Py_NotImplementedStruct=python36._Py_NotImplementedStruct DATA - _Py_SwappedOp=python36._Py_SwappedOp DATA - _Py_TrueStruct=python36._Py_TrueStruct DATA - _Py_VaBuildValue_SizeT=python36._Py_VaBuildValue_SizeT diff --git a/PC/stable_api.h b/PC/stable_api.h new file mode 100644 --- /dev/null +++ b/PC/stable_api.h @@ -0,0 +1,9 @@ +#if Py_LIMITED_API+0<0x03000000 +#error Py_LIMITED_API must be defined to the target version +#endif +#define Py_NO_ENABLE_SHARED +#define PyAPI_FUNC(x) _PyAPI_FUNC[x] +#define PyAPI_DATA(x) _PyAPI_DATA[x] + +#include +#include diff --git a/PC/stable_api_sort.py b/PC/stable_api_sort.py new file mode 100644 --- /dev/null +++ b/PC/stable_api_sort.py @@ -0,0 +1,49 @@ +'''Tool for sorting python3.def alphabetically, case-sensitive, but +sorting underscores after letters. + +Usage: + stable_api_sort.py <# LINES TO SKIP> <# LINES TO PRESERVE> + +''' + +from itertools import islice +import os +import sys + +SOURCE = sys.argv[1] +SOURCE_PREAMBLE = int(sys.argv[2]) +DEST = sys.argv[3] +DEST_PREAMBLE = int(sys.argv[4]) + +with open(SOURCE, 'r', encoding='utf-8') as f_in: + lines = list(f_in) + +lines = lines[SOURCE_PREAMBLE:] + +class SortKey: + def __init__(self, x): + self.x = x + + def __lt__(self, sk_y): + x, y = self.x, sk_y.x + if x == y: + return False + + for cx, cy in zip(x, y): + if cx == cy: continue + if cx == '_': + return False + if cy == '_': + return True + return cx < cy + return len(x) < len(y) + +if DEST_PREAMBLE and os.path.isfile(DEST): + with open(DEST, 'r', encoding='utf-8') as f_in: + preamble = list(islice(f_in, DEST_PREAMBLE)) +else: + preamble = [] + +with open(DEST, 'w', encoding='utf-8') as f_out: + f_out.writelines(preamble) + f_out.writelines(sorted(lines, key=SortKey)) diff --git a/PCbuild/python3dll.vcxproj b/PCbuild/python3dll.vcxproj --- a/PCbuild/python3dll.vcxproj +++ b/PCbuild/python3dll.vcxproj @@ -58,22 +58,23 @@ <_ProjectFileVersion>10.0.30319.1 <_Machine>X86 <_Machine Condition="$(Platform) == 'x64'">X64 - $(ExtensionsToDeleteOnClean);$(IntDir)python3_d.def;$(IntDir)python3stub.def + $(ExtensionsToDeleteOnClean);$(IntDir)$(TargetName).def;$(IntDir)$(TargetName)stub.def + $([System.String]::Format('0x{0:X2}{1:X2}{2:X2}00', $([System.Int32]::Parse($(MajorVersionNumber))), $([System.Int32]::Parse($(MinorVersionNumber))), $([System.Int32]::Parse($(MicroVersionNumber))))) false - $(OutDir)$(TargetName)stub.lib - $(PySourcePath)PC\python3.def - $(IntDir)python3_d.def + $(IntDir)$(TargetName)stub.lib + $(IntDir)$(TargetName).def DllMain + $(TargetName);%(IgnoreSpecificDefaultLibraries) - lib /nologo /def:"$(IntDir)python3stub.def" /out:"$(OutDir)$(TargetName)stub.lib" /MACHINE:$(_Machine) + lib /nologo /def:"$(IntDir)$(TargetName)stub.def" /out:"$(IntDir)$(TargetName)stub.lib" /MACHINE:$(_Machine) Rebuilding $(TargetName)stub.lib - $(OutDir)$(TargetName)stub.lib + $(IntDir)$(TargetName)stub.lib @@ -81,6 +82,13 @@ + + false + $(IntDir)stable_api.txt + Py_LIMITED_API=$(PythonLimitedApiVersion);WIN32;_WIN32 + True + MultiThreadedDLL + @@ -89,49 +97,52 @@ - + - <_DefLines Remove="@(_DefLines)" /> + <_RawLines Remove="@(_RawLines)" /> <_Lines Remove="@(_Lines)" /> - - - - - - <_Pattern1>(=python$(MajorVersionNumber)$(MinorVersionNumber))\. - <_Sub1>$1_d. - <_Pattern2>"python3" - <_Sub2>"python3_d" - - - <_Lines Include="@(_DefLines)"> - $([System.Text.RegularExpressions.Regex]::Replace($([System.Text.RegularExpressions.Regex]::Replace(`%(Identity)`, `$(_Pattern1)`, `$(_Sub1)`)), `$(_Pattern2)`, `$(_Sub2)`)) + <_Lines Include="LIBRARY $(TargetName)"> + LIBRARY "$(TargetName)" + LIBRARY "$(TargetName)" + + + <_Lines Include="EXPORTS"> + EXPORTS + EXPORTS + - - - - - - - <_DefLines Remove="@(_DefLines)" /> - <_Lines Remove="@(_Lines)" /> - - - + + - <_Pattern>^[\w.]+=.+?\.([^ ]+).*$ - <_Sub>$1 + <_Pattern1>^\s*_PyAPI_FUNC\[(.+?)\]\s+([\w_]+).+$ + <_StubSub1> $2 + <_DefSub1> $2=python$(MajorVersionNumber)$(MinorVersionNumber)$(PyDebugExt).$2 + <_TxtSub1>$2(...) -> $1 + <_Pattern2>^\s*_PyAPI_DATA\[(.+?)\]\s+(?:\(\*)?([\w_]+).+$ + <_StubSub2> $2 + <_DefSub2> $2=python$(MajorVersionNumber)$(MinorVersionNumber)$(PyDebugExt).$2 DATA + <_TxtSub2>$2 -> $1 - <_Lines Include="EXPORTS" /> - <_Symbols Include="@(_DefLines)" Condition="$([System.Text.RegularExpressions.Regex]::IsMatch(`%(Identity)`, `$(_Pattern)`))"> - $([System.Text.RegularExpressions.Regex]::Replace(`%(Identity)`, `$(_Pattern)`, `$(_Sub)`)) - - <_Lines Include="@(_Symbols->'%(Symbol)')" /> + <_Lines Include="@(_RawLines)" Condition="$([System.Text.RegularExpressions.Regex]::IsMatch(`%(Identity)`, `$(_Pattern1)`))"> + $([System.Text.RegularExpressions.Regex]::Replace(`%(Identity)`, `$(_Pattern1)`, `$(_StubSub1)`)) + $([System.Text.RegularExpressions.Regex]::Replace(`%(Identity)`, `$(_Pattern1)`, `$(_DefSub1)`)) + $([System.Text.RegularExpressions.Regex]::Replace(`%(Identity)`, `$(_Pattern1)`, `$(_TxtSub1)`)) + + <_Lines Include="@(_RawLines)" Condition="$([System.Text.RegularExpressions.Regex]::IsMatch(`%(Identity)`, `$(_Pattern2)`))"> + $([System.Text.RegularExpressions.Regex]::Replace(`%(Identity)`, `$(_Pattern2)`, `$(_StubSub2)`)) + $([System.Text.RegularExpressions.Regex]::Replace(`%(Identity)`, `$(_Pattern2)`, `$(_DefSub2)`)) + $([System.Text.RegularExpressions.Regex]::Replace(`%(Identity)`, `$(_Pattern2)`, `$(_TxtSub2)`)) + - - + + + + \ No newline at end of file