Re: Interfacing with c and platform dependent sizes

2011-02-27 Thread Jacob Carlborg
On 2011-02-26 17:06, Mike Wey wrote: On 02/26/2011 11:49 AM, Jacob Carlborg wrote: On 2011-02-26 01:28, simendsjo wrote: C is not my strong side, so I'm having some problems wrapping some code. I found a couple of sources on this: 1) http://www.digitalmars.com/d/2.0/htomodule.html 2)

Re: Interfacing with c and platform dependent sizes

2011-02-27 Thread Jacob Carlborg
On 2011-02-26 17:58, simendsjo wrote: On 26.02.2011 17:06, Mike Wey wrote: On 02/26/2011 11:49 AM, Jacob Carlborg wrote: On 2011-02-26 01:28, simendsjo wrote: C is not my strong side, so I'm having some problems wrapping some code. I found a couple of sources on this: 1)

Re: Interfacing with c and platform dependent sizes

2011-02-27 Thread Steven Schveighoffer
On Sat, 26 Feb 2011 22:24:52 -0500, Bekenn leav...@alone.com wrote: On 2/25/2011 7:24 PM, Steven Schveighoffer wrote: BTW, I think long long is a gnu extension, it's not standard C (I don't think long long exists in Visual C for instance). I'm pretty sure it's standard as of C99 (though not

Re: Interfacing with c and platform dependent sizes

2011-02-27 Thread simendsjo
On 27.02.2011 11:43, Jacob Carlborg wrote: On 2011-02-26 17:58, simendsjo wrote: On 26.02.2011 17:06, Mike Wey wrote: On 02/26/2011 11:49 AM, Jacob Carlborg wrote: On 2011-02-26 01:28, simendsjo wrote: C is not my strong side, so I'm having some problems wrapping some code. I found a couple

Re: Interfacing with c and platform dependent sizes

2011-02-27 Thread Jonathan M Davis
On Sunday 27 February 2011 05:41:49 Steven Schveighoffer wrote: On Sat, 26 Feb 2011 22:24:52 -0500, Bekenn leav...@alone.com wrote: On 2/25/2011 7:24 PM, Steven Schveighoffer wrote: BTW, I think long long is a gnu extension, it's not standard C (I don't think long long exists in Visual C

Re: Interfacing with c and platform dependent sizes

2011-02-26 Thread Jacob Carlborg
On 2011-02-26 01:28, simendsjo wrote: C is not my strong side, so I'm having some problems wrapping some code. I found a couple of sources on this: 1) http://www.digitalmars.com/d/2.0/htomodule.html 2) http://www.digitalmars.com/d/2.0/interfaceToC.html 1) C's long is the same as D's int. long

Re: Interfacing with c and platform dependent sizes

2011-02-26 Thread Jacob Carlborg
On 2011-02-26 02:35, Jonathan M Davis wrote: On Friday, February 25, 2011 17:16:31 simendsjo wrote: On 26.02.2011 02:06, bearophile wrote: simendsjo: So.. A long in C is the same as the platform size? And long long doesn't exist in 64 bit? In D the size of int/uint is 32 bits and long/ulong

Re: Interfacing with c and platform dependent sizes

2011-02-26 Thread Mike Wey
On 02/26/2011 11:49 AM, Jacob Carlborg wrote: On 2011-02-26 01:28, simendsjo wrote: C is not my strong side, so I'm having some problems wrapping some code. I found a couple of sources on this: 1) http://www.digitalmars.com/d/2.0/htomodule.html 2)

Re: Interfacing with c and platform dependent sizes

2011-02-26 Thread simendsjo
On 26.02.2011 17:06, Mike Wey wrote: On 02/26/2011 11:49 AM, Jacob Carlborg wrote: On 2011-02-26 01:28, simendsjo wrote: C is not my strong side, so I'm having some problems wrapping some code. I found a couple of sources on this: 1) http://www.digitalmars.com/d/2.0/htomodule.html 2)

Re: Interfacing with c and platform dependent sizes

2011-02-26 Thread Mike Wey
On 02/26/2011 05:58 PM, simendsjo wrote: On 26.02.2011 17:06, Mike Wey wrote: On 02/26/2011 11:49 AM, Jacob Carlborg wrote: On 2011-02-26 01:28, simendsjo wrote: C is not my strong side, so I'm having some problems wrapping some code. I found a couple of sources on this: 1)

Re: Interfacing with c and platform dependent sizes

2011-02-26 Thread Bekenn
On 2/25/2011 7:24 PM, Steven Schveighoffer wrote: BTW, I think long long is a gnu extension, it's not standard C (I don't think long long exists in Visual C for instance). I'm pretty sure it's standard as of C99 (though not yet for C++; that's coming with C++0x). MSVC does indeed support it.

Interfacing with c and platform dependent sizes

2011-02-25 Thread simendsjo
C is not my strong side, so I'm having some problems wrapping some code. I found a couple of sources on this: 1) http://www.digitalmars.com/d/2.0/htomodule.html 2) http://www.digitalmars.com/d/2.0/interfaceToC.html 1) C's long is the same as D's int. long long is long 2) C 32bit's long long is

Re: Interfacing with c and platform dependent sizes

2011-02-25 Thread bearophile
simendsjo: So.. A long in C is the same as the platform size? And long long doesn't exist in 64 bit? In D the size of int/uint is 32 bits and long/ulong is 64 bits. In C the size of int, unsigned int, long, long long int, unsigned long long int, etc are not fixed, the change according to

Re: Interfacing with c and platform dependent sizes

2011-02-25 Thread simendsjo
On 26.02.2011 02:06, bearophile wrote: simendsjo: So.. A long in C is the same as the platform size? And long long doesn't exist in 64 bit? In D the size of int/uint is 32 bits and long/ulong is 64 bits. In C the size of int, unsigned int, long, long long int, unsigned long long int, etc

Re: Interfacing with c and platform dependent sizes

2011-02-25 Thread Steven Schveighoffer
On Fri, 25 Feb 2011 20:06:04 -0500, bearophile bearophileh...@lycos.com wrote: simendsjo: So.. A long in C is the same as the platform size? And long long doesn't exist in 64 bit? In D the size of int/uint is 32 bits and long/ulong is 64 bits. In C the size of int, unsigned int, long,

Re: Interfacing with c and platform dependent sizes

2011-02-25 Thread Jonathan M Davis
On Friday, February 25, 2011 17:35:02 Jonathan M Davis wrote: On Friday, February 25, 2011 17:16:31 simendsjo wrote: On 26.02.2011 02:06, bearophile wrote: simendsjo: So.. A long in C is the same as the platform size? And long long doesn't exist in 64 bit? In D the size of