diff --git a/CCommon.pas b/CCommon.pas index add3ed3..3c1e8d3 100644 --- a/CCommon.pas +++ b/CCommon.pas @@ -153,10 +153,11 @@ type { Basic types (plus the void type) as defined by the C language. } { This differs from baseTypeEnum in that different types with the } { same representation are distinguished from each other. } + { (ctInt32/ctUInt32 are 32-bit int types when using #pragma unix 1.) } cTypeEnum = (ctChar, ctSChar, ctUChar, ctShort, ctUShort, ctInt, ctUInt, ctLong, ctULong, ctFloat, ctDouble, ctLongDouble, ctComp, - ctVoid); + ctVoid, ctInt32, ctUInt32); {tokens} {------} diff --git a/Parser.pas b/Parser.pas index 5934d02..e6e07fa 100644 --- a/Parser.pas +++ b/Parser.pas @@ -2784,14 +2784,14 @@ var or (typeSpecifiers = [signedsy]) or (typeSpecifiers = [signedsy,intsy]) then begin if unix_1 then - myTypeSpec := longPtr + myTypeSpec := int32Ptr else myTypeSpec := intPtr; end {else if} else if (typeSpecifiers = [unsignedsy]) or (typeSpecifiers = [unsignedsy,intsy]) then begin if unix_1 then - myTypeSpec := uLongPtr + myTypeSpec := uInt32Ptr else myTypeSpec := uIntPtr; end {else if} diff --git a/Symbol.pas b/Symbol.pas index 081d8ce..0e2f0ff 100644 --- a/Symbol.pas +++ b/Symbol.pas @@ -32,6 +32,8 @@ { uShortPtr - pointer to the base type for unsigned short } { intPtr - pointer to the base type for int } { uIntPtr - pointer to the base type for unsigned int } +{ int32Ptr - pointer to the base type for 32-bit int } +{ uInt32Ptr - pointer to the base type for 32-bit unsigned int } { longPtr - pointer to the base type for long } { uLongPtr - pointer to the base type for unsigned long } { floatPtr - pointer to the base type for float } @@ -73,8 +75,8 @@ var globalTable: symbolTablePtr; {global symbol table} {base types} - charPtr,sCharPtr,uCharPtr,shortPtr,uShortPtr,intPtr,uIntPtr, - longPtr,uLongPtr,floatPtr,doublePtr,compPtr,extendedPtr, + charPtr,sCharPtr,uCharPtr,shortPtr,uShortPtr,intPtr,uIntPtr,int32Ptr, + uInt32Ptr,longPtr,uLongPtr,floatPtr,doublePtr,compPtr,extendedPtr, stringTypePtr,voidPtr,voidPtrPtr,defaultStruct: typePtr; {---------------------------------------------------------------} @@ -1264,6 +1266,24 @@ with uIntPtr^ do begin baseType := cgUWord; cType := ctUInt; end; {with} +new(int32Ptr); {int (32-bit)} +with int32Ptr^ do begin + size := cgLongSize; + saveDisp := 0; + isConstant := false; + kind := scalarType; + baseType := cgLong; + cType := ctInt32; + end; {with} +new(uInt32Ptr); {unsigned int (32-bit)} +with uInt32Ptr^ do begin + size := cgLongSize; + saveDisp := 0; + isConstant := false; + kind := scalarType; + baseType := cgULong; + cType := ctUInt32; + end; {with} new(longPtr); {long} with longPtr^ do begin size := cgLongSize;