ev1313 / Pascal-SDL-2-Headers

These are the Pascal SDL 2 Headers.
Mozilla Public License 2.0
114 stars 48 forks source link

incompatible types #9

Closed Raith closed 10 years ago

Raith commented 10 years ago

function SDL_RWtell(ctx: PSDL_RWops): SInt64; begin Result := ctx^.seek(ctx, 0, RW_SEEK_CUR); end; [dcc32 Error] SDL2.pas(253): E2010 Incompatible types: 'Int64' and 'Integer'

same problem with Kotai's headers

ev1313 commented 10 years ago

Sry for the long delay. Compiler?

Raith commented 10 years ago

I sort of lost hope of getting a reply, thanks for getting back. I don't recall what delphi version was it back in may (XE4 or 5 most probably), but I've just tested it on XE6 and I got the same issue. I've contacted Kotai and it appears that he has fixed this on his end.

edit: what concerns differences between your headers and Kotai's, he is using PWideChar for IMG_Load(), TTF_RenderText_Solid() and such while you are using PAnsiChar, what's the deal with this?

ev1313 commented 10 years ago

Since SDL is using AnsiStrings I have to use PAnsiChar for every "*char" in the headers.

Raith commented 10 years ago

Alright, so I see. So Kotai's approach is just bad, although his headers are working fine (so far), then again I've already hit a bump with clipboard handling. After changing my code - pasting now semi-works. I guess it is time to switch to PAnsiChar.

Raith commented 10 years ago

Actually, the clipboard handling now works property, even though this is not the issue at hand, but you have helped, thanks a lot. I can't wait to switch to your headers after the real issue is resolved, since everything else compiles just fine if I comment out that one line with the Result. Sorry for being a nub and closing/reopening the issue.

ev1313 commented 10 years ago

I just uploaded the conversions for sdl_clipboard.h and sdl_cpuinfo.h. For the other issue i'm looking later today, since I'm a little bit busy actually.

EDIT: may you could test my clipboard headers?

ev1313 commented 10 years ago

@this issue: I really don't see, where there's an error. In my version all types are Int64 except the parameter "whence" - but this is in the SDL header defined as Int32.

ev1313 commented 10 years ago

Ah, I think i solved it now. The problem was, that Delphi XE5 was not in the jedi.inc - it should be fixed now for all further Delphiversions.

Raith commented 10 years ago

Sorry to be bearer of bad news but it's still complaining about incompatible types, I understand now what was missing and after adding manually for XE6 it's fine. But you still should review that part though because it does not work for future versions.

I am not gonna start a new issue, but something is fishy here too: procedure SDL_LogMessageV(category: Integer; priority: TSDL_LogPriority; const fmt: PAnsiChar; va_list ap);

ev1313 commented 10 years ago

Fixed - hopefully. Could you test it?

Raith commented 10 years ago

Yes I can and everything looks good now. Incompatible types still persists, I do not see any changes in jedi.inc and {$IF RTLVersion >= 26} does not seem to be working as a check for this. This is not a problem for me anymore anyway so it does not matter.

ev1313 commented 10 years ago

How do you fixed it?

Raith commented 10 years ago

The lazy but simple way, I just copy pasted everything from {ifdef ver240} and changed ver240 to ver270 since I am on XE6.

ev1313 commented 10 years ago

Mh. I'm looking for some way doing this compatible for all delphi versions.

Raith commented 9 years ago

this might be of interest if you want an elegant solution: http://stackoverflow.com/questions/23704097/how-to-define-version-and-up-ifdefs-in-delphi

tested and works for XE6/7. you needed to use 'CompilerVersion' instead of 'RTLVersion'.