the definition of DWORD_PTR is an __int64 * look at the 64-bit target compiler
definitions.
can't use. and I'll betcha the ptr itself is 64-bit.
so yeah, ifdef _WIN64 :-)
__MINGW_EXTENSION typedef __int64 INT_PTR,*PINT_PTR;
__MINGW_EXTENSION typedef unsigned __int64 UINT_PTR,*PUINT_PTR;
__MINGW_EXTENSION typedef __int64 LONG_PTR,*PLONG_PTR;
__MINGW_EXTENSION typedef unsigned __int64 ULONG_PTR,*PULONG_PTR;
__MINGW_EXTENSION typedef ULONG_PTR DWORD_PTR,*PDWORD_PTR;
________________________________
From: NightStrike <[email protected]>
To: Jim Michaels <[email protected]>
Cc: mingw64 <[email protected]>; mingw users
<[email protected]>
Sent: Sun, February 21, 2010 4:27:57 PM
Subject: Re: [Mingw-w64-public] x64 can't cast ptr to DWORD
You should be able to use the same code for both if you use DWORD_PTR
On Sun, Feb 21, 2010 at 6:30 PM, Jim Michaels <[email protected]> wrote:
>
>
> it's 32-bit windows 9x code, but the target is 64-bit, so I have to disable
> the 9x code.
> I found a workaround on the internet (great place to look for solutions):
> #if !defined(_WIN64)
> ...//win9x code
> #endif
>
>
> ________________________________
> From: Ozkan Sezer <[email protected]>
> To: Jim Michaels <[email protected]>
> Cc: mingw64 <[email protected]>
> Sent: Fri, February 19, 2010 1:28:02 AM
> Subject: Re: [Mingw-w64-public] x64 can't cast ptr to DWORD
>
> On Fri, Feb 19, 2010 at 11:25 AM, Jim Michaels <[email protected]> wrote:
>> after much difficulty trying to get subscribed to the list, here is my
>> question.
>>
>> #define CAST(x) reinterpret_cast<DWORD>( x )
>> or
>> #define CAST(x) (DWORD)( x )
>> ...
>> // All msdos data structures must be packed on a 1 byte boundary
>> #pragma pack (1)
>> struct {
>> DWORD StartingSector ;
>> WORD NumberOfSectors ;
>> DWORD pBuffer;
>> } ControlBlock;
>> #pragma pack ()
>> ...
>> ControlBlock.pBuffer = CAST(buffer) ;
>>
>> "dgeomlib.cpp:178: error: cast from 'unsigned char*' to 'DWORD' loses
>> precision"
>>
>> this only occurs on 64-bit target compiler.
>> how can I circumvent?
>
> Use DWORD_PTR instead.
>
>> or, how can I use ifdefs to disable this windows 9x code only for x64
>> target
>> (obviously the x64-output compiler must have some sort of #define?)?
>>
>
> #ifdef _WIN64 ... #endif should do?
>
>>
>> Jim Michaels
>> [email protected](main)
>> JesusnJim.com (my site)
>
> --
> Ozkan
> I don't think it's going to fit in 32 bits.
>
>
>
> ------------------------------------------------------------------------------
> Download IntelĀ® Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> Mingw-w64-public mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>
>
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public