Re: xfsprogs and libintl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I guess this is an older version - 3.1.4:

xfs.h includes platform_defs.h:
#ifndef __XFS_H__
#define __XFS_H__

#include <xfs/platform_defs.h>
#include <xfs/xfs_fs.h>

#endif  /* __XFS_H__ */

Which:

/* 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
#include <locale.h>

I'll try to upgrade to a newer version then.

Dan

On 12/3/20, 11:35 AM, "Darrick J. Wong" <darrick.wong@xxxxxxxxxx> wrote:

    On Thu, Dec 03, 2020 at 07:15:39PM +0000, Dan Melnic wrote:
    > 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.

    What public header file?

    $ grep textdomain /usr/include/xfs/
    $ grep ENABLE_GETTEXT /usr/include/xfs/
    $

    > /* 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

    platform_defs.h is private to the xfsprogs code base; what are you
    doing?

    Confused,

    --D

    > 
    > Thanks,
    > 
    > Dan
    > 
    > 





[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux