On Sun, Jan 10, 2016 at 7:52 PM, Mike Williams <
[email protected]> wrote:

> Hi,
>
>
> On 13/12/2015 13:30, Mike Williams wrote:
>
>> Hi all,
>>
>> VS2015 is raising a pointer cast truncation warning in gui_w32.c  On
>> 64bit builds with VC HandleToLong() is a function but for 32bit builds
>> it is a macro.  The current VIM code defines a macro if one is not
>> defined so shadows the function call resulting in the warning.
>>
>> Going through the source history this looks like it got broken when
>> coping with MingW warnings in 7.3.870.  The following patch copes with
>> old MS compilers (for the Win95 hold outs - are there still any?) and
>> MingW.  I don't have MingW so can someone please check the following
>> works for them, and if a 64bit MingW raises its own warning for the cast.
>>
>>
>> diff --git a/src/gui_w32.c b/src/gui_w32.c
>> --- a/src/gui_w32.c
>> +++ b/src/gui_w32.c
>> @@ -1769,9 +1769,11 @@ gui_mch_init(void)
>>    #endif
>>
>>    #ifdef FEAT_EVAL
>> -# ifndef HandleToLong
>> -/* HandleToLong() only exists in compilers that can do 64 bit builds */
>> -#  define HandleToLong(h) ((long)(h))
>> +# if !defined(_MSC_VER) || (_MSC_VER < 1400)
>> +/* Define HandleToLong for old MS and none-MS compilers if not defined */
>> +#  ifndef HandleToLong
>> +#   define HandleToLong(h) ((long)(h))
>> +#  endif
>>    # endif
>>        /* set the v:windowid variable */
>>        set_vim_var_nr(VV_WINDOWID, HandleToLong(s_hwnd));
>>
>>
> Has anyone tried this on MingW?  Any problems?
>

I tried to compile it with mingw32 and mingw64 and I got no warnings.

-- 
Yukihiro Nakadaira - [email protected]

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui