Re: Debug build compile error in 'gobject/gobject.c'

I don't believe you're allowed to legally use macros inside a macro
expansion -

On Wed, Aug 3, 2016 at 10:46 AM, Emmanuele Bassi <ebassi gmail com> wrote:

On 3 August 2016 at 18:36, John Emmas <johne53 tiscali co uk> wrote:
Hi there - I just came across a problem after updating libglib to the latest
git master (my last update was about a fortnight ago).

I'm building with MSVC 8 and when I try to compile 'gobject/gobject.c' the
Release version compiles fine but compiling in Debug mode gives me an error
around these lines at the end of function 'void g_object_type_init (void)
(approximately line 400):-

          debug_objects_ht = g_hash_table_new (g_direct_hash, NULL);
          g_atexit (debug_objects_atexit);

The error I see is:-

      gobject\gobject.c(403) : error C2121: '#' : invalid character :
possibly the result of a macro expansion

AFAICT gobject.c itself hasn't changed recently so is it possible that
GOBJECT_IF_DEBUG has changed somehow?  The Release build compiles okay so I
guess that seems plausible.  Thanks,

This is likely a MSVC 8 issue. The GOBJECT_IF_DEBUG macro expands the
second argument to a code block, and it seems MSVC 8 has issues when
that includes a conditional pre-processor directive.

GOBJECT_IF_DEBUG hasn't changed since 2014, and the same commit
introduced the use you see failing.


[@] ebassi []
gtk-devel-list mailing list
gtk-devel-list gnome org

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]