[HarfBuzz] MSVC compile issue with latest git master

Behdad Esfahbod behdad at behdad.org
Fri Sep 7 14:40:10 UTC 2018


Also, we have MSVC bots, but they are happy.  Weird.

On Fri, Sep 7, 2018 at 7:39 AM, Behdad Esfahbod <behdad at behdad.org> wrote:

> Interesting.  I added the cast because this page:
>
>   https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-
> interlockedexchangeadd
>
> suggested it takes unsigned.  Can you check if just removing the cast
> works?
>
> On Thu, Sep 6, 2018 at 11:28 PM, John Emmas <john at creativepost.co.uk>
> wrote:
>
>> Apologies if this comes through twice (yesterday, I accidentally posted
>> while being unsubscribed). Here's a link on MSDN which might be helpful...
>>
>> https://msdn.microsoft.com/en-us/library/191ca0sk.aspx
>>
>> On 06/09/2018 15:19, John Emmas wrote:
>>
>>> I updated from git today and I've hit a problem when building with
>>> MSVC...
>>>
>>> Trying to compile almost any source file produces the following compiler
>>> error at lines 255 and 256 of 'hb-atomic.hh':-
>>>
>>>    error C2664: 'InterlockedExchangeAdd' : cannot convert parameter 1
>>> from 'unsigned int *' to 'volatile LONG *'
>>>
>>> Here are the relevant lines:-
>>>
>>>    inline int inc (void) { return hb_atomic_int_impl_add (&v, 1); }
>>>    inline int dec (void) { return hb_atomic_int_impl_add (&v, -1); }
>>>
>>> and here's how 'hb_atomic_int_impl_add()' looks (at line 109):-
>>>
>>>    #define hb_atomic_int_impl_add(AI, V)    InterlockedExchangeAdd
>>> ((unsigned *) (AI), (V)
>>>
>>> If I change the above line to this, the compiler error goes away:-
>>>
>>>    #define hb_atomic_int_impl_add(AI, V)    InterlockedExchangeAdd
>>> ((volatile LONG *) (AI), (V)
>>>
>>> I'm building with MSVC-8 so could someone check on some other versions
>>> please with a view to making the change permanent? Thanks.
>>>
>>> John
>>>
>>>
>>>
>> _______________________________________________
>> HarfBuzz mailing list
>> HarfBuzz at lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/harfbuzz
>>
>
>
>
> --
> behdad
> http://behdad.org/
>



-- 
behdad
http://behdad.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/harfbuzz/attachments/20180907/d470881c/attachment.html>


More information about the HarfBuzz mailing list