Web lists-archives.com

Re: Broken 'C' compilation when building from Master with MSVC




Hi;

On 2 November 2015 at 22:50, Arnavion <arnavion@xxxxxxxxx> wrote:
> https://github.com/GNOME/glib/blob/236e804/glib/gutils.h#L69
> Presumably this is not being included by gtypes.h
>
> inline in C is a C99 feature, which is why older VS doesn't support
> it. VS2015 does.

I'm pretty sure MSVC versions prior to the one in Visual Studio 2015
support `static inline` function declarations.

Ciao,
 Emmanuele.

> -Arnav
>
> On Mon, Nov 2, 2015 at 2:27 PM, Emmanuele Bassi <ebassi@xxxxxxxxx> wrote:
>> Hi;
>>
>> On 2 November 2015 at 20:10, John Emmas <johne53@xxxxxxxxxxxxx> wrote:
>>> This is my third attempt to reply to Emmanuele so apologies if this comes
>>> through in duplicate (or even triplicate!!)  My posts to this list seem to
>>> frequently get lost somewhere (for some reason I've never understood).
>>> Anyway, here's what I wrote...
>>>
>>>
>>> On 02/11/2015 16:56, Emmanuele Bassi wrote:
>>>
>>> you should try the patch attached to this bug:
>>>
>>>
>>> https://bugzilla.gnome.org/show_bug.cgi?id=503096#c26
>>>
>>>
>>> and see if it fixes the issue for you.
>>>
>>>
>>>
>>> Thanks for the quick reply Emmanuele.
>>>
>>> If you're referring to the problem with G_STATIC_ASSERT it's not relevant in
>>> my case because _GLIB_HAVE_BUILTIN_OVERFLOW_CHECKS doesn't seem to be
>>> defined anywhere.  However, if I explicitly #define it (and then apply the
>>> patch) that doesn't help.  I then just see the same error occur at line 417
>>> instead of 427.
>>>
>>> I've a strange feeling that we might need underscores here with MSVC 'C'.
>>> The compiler seems happy with "_inline" and "__inline" - but "inline" is
>>> only accepted when building as C++.  I must admit, that comes as a bit of a
>>> surprise!!
>>
>> Indeed, given that GLib and GTK+ use inline all over the place — and
>> GLib requires support for static inline functions as part of the
>> toolchain requirements:
>>
>>   https://wiki.gnome.org/Projects/GLib/CompilerRequirements
>>
>> GLib has a bunch of macros to allow some sort of ABI compatibility
>> when using compilers that have different ideas about the inline
>> keyword, but that's just for legacy code.
>>
>> Which version of MSVC are you using?
>>
>> Ciao,
>>  Emmanuele.
>>
>>
>> --
>> https://www.bassi.io
>> [@] ebassi [@gmail.com]
>> _______________________________________________
>> gtk-devel-list mailing list
>> gtk-devel-list@xxxxxxxxx
>> https://mail.gnome.org/mailman/listinfo/gtk-devel-list



-- 
https://www.bassi.io
[@] ebassi [@gmail.com]
_______________________________________________
gtk-devel-list mailing list
gtk-devel-list@xxxxxxxxx
https://mail.gnome.org/mailman/listinfo/gtk-devel-list