Recently, I've tried to update a custom backup program written in Borland C++ Builder from dbtools 9 to dbtools 10, and I've started getting strange error messages. After some investigation using MSVC I discovered that size of chkpt_log_type member in a_backup_db structure is 1 byte in C++B and 4 bytes in MSVC. With my C knowledge being between 'weak' and 'nonexistent', I copied dbtools.h to my project and inserted 3 bytes stuffing after the chkpt_log_type. It did the trick for me, but I am unsure it is the best solution (and if it is correct at all), hence I'm asking for the better option.

asked 03 Dec '09, 14:07

Dmitri's gravatar image

accept rate: 11%

edited 03 Dec '09, 16:19

Zote's gravatar image


As to the question "What's the size of an enum?", you may have a look at StackOverflow.

AFAIK, the size is partly compiler-dependent, and MSVC seems to use an int whereas C++ only requires the smallest binary size that can store all values - what could be 3 bits in this particular case.

Besides these facts, I can't tell whether this might lead to further problems when compling the DBTools LIB against different compilers. I would suggest to use the fitting LIB (Borland or MS). Note that in SA 11 there's no more support for Borland compilers on Windows plattforms.

Oops, I have to correct myself: There's no more Borland LIB in SA 11 but a .DEF file as substitute.

permanent link

answered 03 Dec '09, 15:52

Volker%20Barth's gravatar image

Volker Barth
accept rate: 34%

edited 03 Dec '09, 16:12

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 03 Dec '09, 14:07

question was seen: 4,328 times

last updated: 03 Dec '09, 16:19