RFC - mysqlD

Jonathan M Davis jmdavisProg at gmx.com
Sun Oct 9 14:35:35 PDT 2011


On Sunday, October 09, 2011 19:37:31 GrahamC wrote:
> Don't forget that quite a few MySQL data structure members are C long types
> which are 64 bit on x86_64.
> 
> So if you want code to work on x86_64 as well as x86 it needs a type alias.
> 
> For example in st_net these members:
> 
> struct st_net
> {
>     Vio *vio;
>     ubyte *buff;
>     ubyte *buff_end;
>     ubyte *write_pos;
>     ubyte *read_pos;
>     SOCKET fd;
>     uint remain_in_buf;   <<<
>     uint length;          <<<
>     uint buf_length;      <<<
>     uint where_b;         <<<
>     uint max_packet;      <<<
>     uint max_packet_size; <<<
> 
> 
> are 32 bit on x86 and 64 bit on x86_64
> 
> Many other MySQL structures and quite a few function arguments have the same
> issue.
> 
> Of course, not many people seem to be using the compiler for 64 bit code at
> the moment.

The C types which may differ between x86 and x86_64 are defined in 
core.stdc.config.

- Jonathan M Davis


More information about the Digitalmars-d mailing list