[HarfBuzz] Funky harfbuzz compile error

Wouter Bolsterlee wbolster at gnome.org
Tue Apr 26 14:46:13 PDT 2011


Hi Ed,

Ed schreef op di 26-04-2011 om 16:44 [-0400]:
> What is the solution to this error seen on Ubuntu with a fresh git
> clone of harfbuzz? , trying to compile with gcc 4.4.5:
> 
> The "set" function on line 47 is declared void but returns a value?
> Looks very odd to me ...
> 
> ===============================
> In file included from hb-private.hh:298,
>                  from hb-blob.cc:27:
> hb-object-private.hh: In member function ‘void<anonymous struct>::set(int)’:
> hb-object-private.hh:47: error: expected primary-expression before ‘do’
> hb-object-private.hh:47: error: return-statement with a value, in
> function returning 'void'
> hb-object-private.hh:47: error: expected ‘;’ before ‘do’
> ===============================

At a first glance, this looks a lot like the issue and patch reported
earlier today by Bradley Grainger. See the thread with the subject
"[PATCH] Implement threading primitives on Windows; fix compile error
and leak" for more info.

Anyway, Bradley's patch is the one pasted below. You might try it to see
if it fixes your problem:

        diff --git a/src/hb-object-private.hh b/src/hb-object-private.hh
        index 0a055e9..d61751a 100644
        --- a/src/hb-object-private.hh
        +++ b/src/hb-object-private.hh
        @@ -44,7 +44,7 @@ typedef struct {
           inline void init (int v) { ref_count = v; /* non-atomic is fine */ }
           inline int inc (void) { return hb_atomic_int_fetch_and_add (ref_count,  1); }
           inline int dec (void) { return hb_atomic_int_fetch_and_add (ref_count, -1); }
        -  inline void set (int v) { return hb_atomic_int_set (ref_count, v); }
        +  inline void set (int v) { hb_atomic_int_set (ref_count, v); }

HTH.

    — Wouter

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/harfbuzz/attachments/20110426/50f372b9/attachment.pgp>


More information about the HarfBuzz mailing list