This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: missing API for locale_t in <locale.h>


Roland McGrath wrote:
> I'm considering putting in the following change, but I'd like some more
> opinions on it first.

Looks good to me.

The only point I'm not sure about is that a few lines below there is some
code that purports to avoid dragging in all categories at link time when
linking statically:

#elif defined NL_CURRENT_INDIRECT
  /* Make direct reference to every _nl_current_CATEGORY symbol,
     since we know only at runtime which categories are used.  */
  switch (category)
    ...
#else
  data = _NL_CURRENT_DATA (category);
#endif

Is that code really useful? (nl_langinfo.os will drag in all categories
through the 'switch' statement, so what's the point?) If so, does it mean
that you need to add an "#elif defined NL_CURRENT_INDIRECT" case to
the new code that accesses _NL_CURRENT_LOCALE->__names[category];
as well?

> I'm not adding any sort of versioning to the interface to distinguish old
> ones without this support from new ones with.

That's OK. Applications can use a compile-time test for
#ifdef NL_LOCALE_NAME. I wouldn't care about applications which want to run
on older versions of glibc than the one they were compiled against, but
- as you say - this kind of situation can be covered through testing the
result against "".

Bruno


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]