Delphi XE4 Indy compatibility issue between TBytes and TidBytes -


today try compile xe3 project in xe4. first problem face indy's ftcpclient.socket.readbytes() method.

before accepting tbytes type, insists on tidbytes.

definitions: tidbytes = array of byte; tbytes, im not sure guess generics tarray array of byte.

question number 1: why compiler complain saying that'[dcc32 error] historicalstockdata.pas(298): e2033 types of actual , formal var parameters must identical'. see identical.

question number 2: should modify source code each new delphi version?

thanks.

the reason tidbytes simple alias tbytes in earlier indy 10 releases compatibility sysutils.tencoding, uses tbytes. indy's tidtextencoding type used simple alias sysutils.tencoding in d2009+, tidbytes needed simple alias tbytes match.

however, tbytes caused quite bit of trouble indy in xe3, because of rtti problems generics (tbytes simple alias tarray<byte> in recent delphi releases). so, indy 10.6 re-designed tidtextencoding no longer rely on sysutils.tencoding @ (there other reasons doing so), allowed tidbytes change own array type in order avoid xe3 issues moving forward.

on other hand, passing tbytes tidbytes expected, bad programming on part not following indy's defined interface in first place. of indy 10's byte-based operations, including readbytes(), have operated on tidbytes only. fact tidbytes silently mapped tbytes implementation detail should not have relied on in code. indy 10 expects tidbytes, use tidbytes, not have compiler errors incompatible types.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -