64 bit types and C libraries
torhu
fake at address.dude
Tue May 22 07:27:27 PDT 2007
Regan Heath wrote:
> Hi all,
>
> I am throwing my hand at writing D ports of the OpenSSL libraries. It looks like a mammoth task but I figure I'll just chip away at it a piece at a time.
>
> This seems like the right time to ask if anyone else is having a go at it, or wants to give me a hand. I've actually just got a job (yay me) but wont start for a bit (11th June) so I have some spare time. Once I start work I wont have as much time so it would be good to find someone else who can help.
>
> In the meantime I have reached a point where a type PQ_64BIT is used. Looking at the headers it appears this type is defined differently for each system/compiler based on whether they have a 64 bit type, so on windows using M$ compilers etc it is __int64 for example. In the rest of cases it is a custom BIGNUM struct.
>
> My question is this.. what the heck do I put in my D port when I see this type used?
>
> In D, long is a 64 bit type, but... I'm not writing new code I am writing a wrapper so I need to put the actual type the C library is using (was compiled using), otherwise any struct using PQ_64BIT might be the wrong size and disastrous things might happen.
>
> Am I understanding this correctly?
>
> It seems that I can probably get away with swapping PQ_64BIT for long in the short term, as I suspect my library was compiled with a 64bit type, not the BIGNUM struct...
>
> Thoughts?
>
>
How's the BIGNUM struct defined?
More information about the Digitalmars-d-learn
mailing list