Ticket #1093 (closed defect: fixed)

Opened 8 years ago

Last modified 7 years ago

Compiling with pango-1.15.0 fails

Reported by: duncan Owned by: axel
Priority: normal Milestone: 0.9.11
Component: Pango bindings Version: 0.9.11
Keywords: Cc:

Description

I pango 1.15.0 in the file /usr/include/pango-1.0/pango/pango-item.h there is this declaration:

{
  PangoEngineShape *shape_engine;
  PangoEngineLang  *lang_engine;
  PangoFont *font;

  guint level : 8;
  guint gravity : 3; /* PangoGravity */
  guint centered_baseline : 1; /* gboolean */

  PangoLanguage *language;
  GSList *extra_attrs;
};

struct _PangoItem
{
  gint offset;
  gint length;
  gint num_chars;
  PangoAnalysis analysis;
};

This makes our binding fail:

pangoItemRawGetLevel :: Ptr pangoItem -> IO Bool
pangoItemRawGetLevel ptr = do
  level <- #{peek PangoItem, analysis.level} ptr
  return (toBool (level :: #{type guint8}))

With the error message:

Structs.hsc: In function 'main':
Structs.hsc:766: error: attempt to take address of bit-field structure member 'level'

In the older pango version it was declared as a guint8 rather than as a bitfield. We might need a bit of C code to get that member and return it. Or can we do away with that function entirely? Is it needed?

Change History

Changed 7 years ago by duncan

  • status changed from new to closed
  • resolution set to fixed

Fortunately this one fixed itself. The pango people realised this was an api break and reverted it. So this change never appeared in a released version so we do not have to worry about it.

Note: See TracTickets for help on using tickets.