linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* xfsprogs and libintl
@ 2020-12-03 19:15 Dan Melnic
  2020-12-03 19:35 ` Darrick J. Wong
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Melnic @ 2020-12-03 19:15 UTC (permalink / raw)
  To: linux-xfs; +Cc: Omar Sandoval

Hi,

If we compile some code both with libintl.h and libxfs/xfsprogs, we can end up, based on the include order, with the 
# define textdomain(d) do { } while (0) 
before: 
extern char *textdomain (const char *__domainname) __THROW;

This will cause a compile error.
I think the ENABLE_GETTEXT check should not leak into any public headers.
/* Define if you want gettext (I18N) support */
#undef ENABLE_GETTEXT
#ifdef ENABLE_GETTEXT
# include <libintl.h>
# define _(x)                   gettext(x)
# define N_(x)  x
#else
# define _(x)                   (x)
# define N_(x)  x
# define textdomain(d)          do { } while (0)
# define bindtextdomain(d,dir)  do { } while (0)
#endif

https://github.com/osandov/xfsprogs/blob/master/include/platform_defs.h.in#L48

Thanks,

Dan



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-12-03 20:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-03 19:15 xfsprogs and libintl Dan Melnic
2020-12-03 19:35 ` Darrick J. Wong
2020-12-03 20:05   ` Dan Melnic
2020-12-03 20:19     ` Eric Sandeen
2020-12-03 20:38       ` Dan Melnic

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).