EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Conflicting TBytes defined in SBB12

Also by EldoS: CallbackFilter
A component to monitor and control disk activity, track file and directory operations (create, read, write, rename etc.), alter file data, encrypt files, create virtual files.
#30726
Posted: 09/15/2014 09:19:20
by Petr Stransky (Standard support level)
Joined: 09/24/2012
Posts: 19

I've been upgrading SBB in our product from version 11 to version 12. Except few cosmetic changes I found that there is defined type TBytes in SBTypes.pas.

it is defined as alias for ByteArray
Code
  TBytes = ByteArray;

and it is conflicting with the definition of Delphi TBytes in SysUtils unit.

What is the reason for it?
#30727
Posted: 09/15/2014 09:27:59
by Eugene Mayevski (EldoS Corp.)

Earlier versions of Delphi (until Delphi 2007) didn't have TBytes declared.

We'll remove this type altogether from the source code in build 261 (build 260 is being built right now).


Sincerely yours
Eugene Mayevski
#30728
Posted: 09/15/2014 09:36:47
by Petr Stransky (Standard support level)
Joined: 09/24/2012
Posts: 19

Thanks for the quick response.

I am glad to hear that the definition will be removed (or it can be IFDEFed for older Delphi versions)
#30815
Posted: 09/25/2014 10:02:14
by Darian Miller (Standard support level)
Joined: 06/27/2011
Posts: 48

I was just attempting to run some code under SBB12 and came across this TBytes issue which I attempted to change on my end but it just started to turn into a mess.

It looks like we can just edit SBTypes and make some little changes:

Redefine ByteArray to TBytes if Delphi 2007+

{$ifdef D_11_UP} //add
ByteArray = TBytes; //add
{$else} //add
ByteArray = array of byte;
{$endif} //add


Don't redefine TBytes if Delphi 2007+
{$ifndef D_11_UP} //add
TBytes = ByteArray;
{$endif} //add


I'm not sure when TBytes was added to Delphi. I know it's Delphi 2007 at least.(D_11_UP)

I haven't run any tests yet, but at least it compiles! : )
#36370
Posted: 03/31/2016 21:44:45
by Darian Miller (Standard support level)
Joined: 06/27/2011
Posts: 48

Please remove this redundant TBytes definition!

It was stated back in 2014 that is was going to go away... it's such a source of pain. We can't easily mix code that calls your routines with TBytes parameters with other code that uses the built in TBytes parameters in other routines.

The disaster can easily be seen by simply commenting out the redundant TBytes definition in SBTypes.pas...then your code doesn't compile with the latest versions of Delphi even though TBytes is built-in type.

Every major version is seems to change a little and causes more work-arounds.
#36374
Posted: 04/01/2016 04:49:35
by Vsevolod Ievgiienko (EldoS Corp.)

Hello.

According to the code it was removed in the latest build.
#36382
Posted: 04/01/2016 15:40:13
by Darian Miller (Standard support level)
Joined: 06/27/2011
Posts: 48

Hallelujah! Thanks.

Now to remove the work arounds...
Also by EldoS: Rethync
The cross-platform framework that simplifies synchronizing data between mobile and desktop applications and servers and cloud storages

Reply

Statistics

Topic viewed 1585 times

Number of guests: 2, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!