@@ -397,11 +397,6 @@ TPythonVersionProp = record
397397 TPWideChar = array [0 ..16000 ] of PWideChar;
398398 PPAnsiChar = ^TPAnsiChar;
399399 PPWideChar = ^TPWideChar;
400- PInt = ^Integer;
401- PDouble = ^Double;
402- PFloat = ^Real;
403- PLong = ^LongInt;
404- PShort = ^ShortInt;
405400
406401
407402// #######################################################
@@ -1536,17 +1531,17 @@ TPythonInterface=class(TDynamicDll)
15361531
15371532 public
15381533 // define Python flags. See file pyDebug.h
1539- Py_DebugFlag: PInt ;
1540- Py_VerboseFlag: PInt ;
1541- Py_InteractiveFlag: PInt ;
1542- Py_OptimizeFlag: PInt ;
1543- Py_NoSiteFlag: PInt ;
1544- Py_UseClassExceptionsFlag: PInt ;
1545- Py_FrozenFlag: PInt ;
1546- Py_TabcheckFlag: PInt ;
1547- Py_UnicodeFlag: PInt ;
1548- Py_IgnoreEnvironmentFlag: PInt ;
1549- Py_DivisionWarningFlag: PInt ;
1534+ Py_DebugFlag: PInteger ;
1535+ Py_VerboseFlag: PInteger ;
1536+ Py_InteractiveFlag: PInteger ;
1537+ Py_OptimizeFlag: PInteger ;
1538+ Py_NoSiteFlag: PInteger ;
1539+ Py_UseClassExceptionsFlag: PInteger ;
1540+ Py_FrozenFlag: PInteger ;
1541+ Py_TabcheckFlag: PInteger ;
1542+ Py_UnicodeFlag: PInteger ;
1543+ Py_IgnoreEnvironmentFlag: PInteger ;
1544+ Py_DivisionWarningFlag: PInteger ;
15501545 // _PySys_TraceFunc: PPPyObject;
15511546 // _PySys_ProfileFunc: PPPPyObject;
15521547
@@ -1646,16 +1641,6 @@ TPythonInterface=class(TDynamicDll)
16461641 PyBool_Type: PPyTypeObject;
16471642 PyEnum_Type: PPyTypeObject;
16481643
1649- // PyArg_GetObject: function(args : PPyObject; nargs, i: integer; p_a: PPPyObject): integer; cdecl;
1650- // PyArg_GetLong: function(args : PPyObject; nargs, i: integer; p_a: PLong): integer; cdecl;
1651- // PyArg_GetShort: function(args : PPyObject; nargs, i: integer; p_a: PShort): integer; cdecl;
1652- // PyArg_GetFloat: function(args : PPyObject; nargs, i: integer; p_a: PFloat): integer; cdecl;
1653- // PyArg_GetString: function(args : PPyObject; nargs, i: integer; p_a: PAnsiString): integer; cdecl;
1654- // PyArgs_VaParse: function (args : PPyObject; format: PAnsiChar; va_list: array of const): integer; cdecl;
1655- // Does not work!
1656- // Py_VaBuildValue: function (format: PAnsiChar; va_list: array of const): PPyObject; cdecl;
1657- // PyBuiltin_Init: procedure; cdecl;
1658-
16591644 PyComplex_FromCComplex: function(c: Py_complex):PPyObject; cdecl;
16601645 PyComplex_FromDoubles: function(realv,imag : double):PPyObject; cdecl;
16611646 PyComplex_RealAsDouble: function(op : PPyObject ): double; cdecl;
@@ -1748,14 +1733,14 @@ TPythonInterface=class(TDynamicDll)
17481733 PyFunction_New:function (ob1,ob2:PPyObject):PPyObject; cdecl;
17491734 PyImport_AddModule:function (name :PAnsiChar):PPyObject; cdecl;
17501735 PyImport_Cleanup:procedure; cdecl;
1751- PyImport_GetMagicNumber:function :LONGINT ; cdecl;
1736+ PyImport_GetMagicNumber:function :LongInt ; cdecl;
17521737 PyImport_ImportFrozenModule:function (key:PAnsiChar):integer; cdecl;
17531738 PyImport_ImportModule:function (name :PAnsiChar):PPyObject; cdecl;
17541739 PyImport_Import:function (name :PPyObject):PPyObject; cdecl;
17551740 // PyImport_Init:procedure; cdecl;
17561741 PyImport_ReloadModule:function (ob:PPyObject):PPyObject; cdecl;
17571742 PyInstance_New:function (obClass, obArg, obKW:PPyObject):PPyObject; cdecl;
1758- PyInt_AsLong:function (ob:PPyObject):LONGINT ; cdecl;
1743+ PyInt_AsLong:function (ob:PPyObject):LongInt ; cdecl;
17591744 PyList_Append:function (ob1,ob2:PPyObject):integer; cdecl;
17601745 PyList_AsTuple:function (ob:PPyObject):PPyObject; cdecl;
17611746 PyList_GetItem:function (ob:PPyObject;i:NativeInt):PPyObject; cdecl;
@@ -1768,9 +1753,9 @@ TPythonInterface=class(TDynamicDll)
17681753 PyList_Size:function (ob:PPyObject):NativeInt; cdecl;
17691754 PyList_Sort:function (ob:PPyObject):integer; cdecl;
17701755 PyLong_AsDouble:function (ob:PPyObject):DOUBLE; cdecl;
1771- PyLong_AsLong:function (ob:PPyObject):LONGINT ; cdecl;
1756+ PyLong_AsLong:function (ob:PPyObject):LongInt ; cdecl;
17721757 PyLong_FromDouble:function (db:double):PPyObject; cdecl;
1773- PyLong_FromLong:function (l:longint ):PPyObject; cdecl;
1758+ PyLong_FromLong:function (l:LongInt ):PPyObject; cdecl;
17741759 PyLong_FromString:function (pc:PAnsiChar;var ppc:PAnsiChar;i:integer):PPyObject; cdecl;
17751760 PyLong_FromUnsignedLong:function(val:cardinal) : PPyObject; cdecl;
17761761 PyLong_AsUnsignedLong:function(ob:PPyObject) : Cardinal; cdecl;
@@ -3292,12 +3277,12 @@ procedure TPythonInputOutput.AddPendingWrite;
32923277
32933278function TPythonInputOutput.GetCurrentThreadSlotIdx : Integer;
32943279var
3295- thread_id : Longint ;
3280+ thread_id : NativeInt ;
32963281 i : Integer;
32973282begin
32983283 thread_id := GetCurrentThreadId;
32993284 for i := 0 to FLinesPerThread.Count-1 do
3300- if Longint (FLinesPerThread.Objects[i]) = thread_id then
3285+ if NativeInt (FLinesPerThread.Objects[i]) = thread_id then
33013286 begin
33023287 Result := i;
33033288 Exit;
@@ -3729,14 +3714,6 @@ procedure TPythonInterface.MapDll;
37293714 PyBool_Type := Import (' PyBool_Type' );
37303715 PyEnum_Type := Import (' PyEnum_Type' );
37313716
3732- // @PyArg_GetObject := Import('PyArg_GetObject');
3733- // @PyArg_GetLong := Import('PyArg_GetLong');
3734- // @PyArg_GetShort := Import('PyArg_GetShort');
3735- // @PyArg_GetFloat := Import('PyArg_GetFloat');
3736- // @PyArg_GetString := Import('PyArg_GetString');
3737- // @PyArgs_VaParse := Import('PyArgs_VaParse');
3738- // @Py_VaBuildValue := Import('Py_VaBuildValue');
3739- // @PyBuiltin_Init := Import('PyBuiltin_Init');
37403717 PyComplex_FromCComplex := Import (' PyComplex_FromCComplex' );
37413718 PyComplex_FromDoubles := Import (' PyComplex_FromDoubles' );
37423719 PyComplex_RealAsDouble := Import (' PyComplex_RealAsDouble' );
@@ -4747,7 +4724,7 @@ procedure TPythonEngine.DoOpenDll(const aDllName : string);
47474724
47484725procedure TPythonEngine.AssignPyFlags ;
47494726
4750- procedure SetFlag ( AFlag: PInt ; AValue : Boolean );
4727+ procedure SetFlag ( AFlag: PInteger ; AValue : Boolean );
47514728 begin
47524729 if AValue then
47534730 AFlag^ := 1
@@ -5886,7 +5863,7 @@ function TPythonEngine.VariantAsPyObject( const V : Variant ) : PPyObject;
58865863 wStr := ' '
58875864 else
58885865 wStr := DeRefV;
5889- Result := PyUnicode_FromWideChar( PWideChar( wStr), Length(wStr) );
5866+ Result := PyUnicode_FromWideString( wStr);
58905867 end ;
58915868 varString:
58925869 begin
@@ -5895,8 +5872,8 @@ function TPythonEngine.VariantAsPyObject( const V : Variant ) : PPyObject;
58955872 end ;
58965873 varUString:
58975874 begin
5898- wStr := DeRefV;
5899- Result := PyUnicode_FromWideChar( PWideChar( wStr), Length(wStr) );
5875+ wStr := DeRefV;
5876+ Result := PyUnicode_FromWideString( wStr);
59005877 end ;
59015878 else
59025879 if VarType(DeRefV) and varArray <> 0 then
@@ -9765,13 +9742,13 @@ procedure MaskFPUExceptions(ExceptionsMasked : boolean;
97659742 exOverflow, exUnderflow, exPrecision])
97669743 else
97679744 SetExceptionMask([exDenormalized, exUnderflow, exPrecision]);
9768- { $IFNDEF NEXTGEN }{ $ WARN SYMBOL_PLATFORM OFF}
9745+ { $WARN SYMBOL_PLATFORM OFF}
97699746 { $IF Defined(FPC) or Defined(MSWINDOWS)}
97709747 if MatchPythonPrecision then
97719748 SetPrecisionMode(pmDouble)
97729749 else
97739750 SetPrecisionMode(pmExtended);
9774- { $ENDIF !NEXTGEN }{ $ WARN SYMBOL_PLATFORM ON}
9751+ { $WARN SYMBOL_PLATFORM ON}
97759752 { $IFEND}
97769753 { $IFEND}
97779754end ;
0 commit comments