Define processor architecture in D

I have a C header file (this is part of some SDK), and there is a typedef that depends on the system architecture (be it 32 or 64-bit), how can I transfer it to my D-module? Thanks.

Edit: ok, that was too easy, and I already found a solution ... If anyone is interested, this is:

version(X86) { typedef int your_type; } version(X86_64) { typedef long your_type; } 
+6
header d
source share
1 answer
 version(X86) { // 32-bit } else version(X86_64) { // 64-bit } else { // none of the above } 

Source: http://digitalmars.com/d/2.0/version.html

+9
source share

All Articles