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 <jmich...@yahoo.com> 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 <seze...@gmail.com>
> To: Jim Michaels <jmich...@yahoo.com>
> Cc: mingw64 <mingw-w64-public@lists.sourceforge.net>
> 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 <jmich...@yahoo.com> 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
>> jmich...@yahoo.com(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
> Mingw-w64-public@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>
>

------------------------------------------------------------------------------
Download Intel&#174; 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
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to