[Flac-dev] new ordinal typing

Josh Coalson xflac at yahoo.com
Tue Jun 26 14:08:16 PDT 2001

> > After working on some more plugins I realized that the naming for
> > flac's
> > ordinal types were not going to cut it.  There is too much chance
> >  for
> > conflicts with other libraries/programs with names like 'bool' and
> > 'uint32'
> > so I went back and prefixed all flac ordinal types with 'FLAC__'. 
> > It makes
> > the code a little harder to read until you get used to it but
> > should make the
> > interface more stable.  It's all been checked in over the weekend. 
> > See
> > include/FLAC/ordinals.h for the main changes.
> I don't know how you feel about adding a build-time dependency to
> flac (I
> personally prefer shared code over fewer dependencies), but this is
> one part of
> what glib does for you, and it does it very well.  See:
> http://developer.gnome.org/doc/API/glib/glib-basic-types.html
> You get fixed-size integral data types that are guaranteed to be the
> same
> across platforms.

glib handles it well but it is still vulnerable to a basic
problem in C, that there is only one global namespace
(for types at least).  So to be safe you have emulate it
with prefixes or suffixes and glib only uses 'g', which
is not really unique enough to give a warm feeling that
it won't interfere with types from another package that
flac might depend on later.

I think the FLAC__ prefix is pretty safe.  Also, I saw that
the configure.in for the ogg tools has a pretty good size
detection mechanism (using heuristics and AC_CHECK_SIZEOF)
so I think once I add that in, things will be pretty solid.


Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail

More information about the Flac-dev mailing list