On Wed, Jan 18, 2017 at 10:52:32PM +0300, Alexander Monakov wrote: > Sorry for not noticing this earlier, but ... > > > +#ifdef __LP64__ > > +typedef unsigned long long CUdeviceptr; > > +#else > > +typedef unsigned CUdeviceptr; > > +#endif > > I think this #ifdef doesn't do the right thing on MinGW. > Would it be fine to simplify it? In my code I have > > typedef uintptr_t CUdeviceptr;
I think it depends on if we want to use CUdeviceptr typed variables in printf like format strings, or C++ overloading (then the exact type is significant and we should go for probably -#ifdef __LP64__ +#if defined(__LP64__) || defined(_WIN64) (is that the right define for 64-bit MingW, right?). Otherwise, I think using uintptr_t is a problem, because we'd need to #include <stdint.h> (the header only includes <stdlib.h>). Another option is typedef __UINTPTR_TYPE__ CUdeviceptr; Jakub