Re: [COMMITTERS] pgsql: Use _() macro consistently rather than gettext(). - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: [COMMITTERS] pgsql: Use _() macro consistently rather than gettext().
Date
Msg-id 200502221816.j1MIG8Q09655@candle.pha.pa.us
Whole thread Raw
List pgsql-patches
Thanks.  Fixed.  I wasn't aware the the macro namespace didn't
distinguish X(a) and X(a,b) as different macros, so I was undefining
_(x).

---------------------------------------------------------------------------

Neil Conway wrote:
> Bruce Momjian wrote:
> > Use _() macro consistently rather than gettext().  Add translation
> > macros around strings that were missing them.
>
> This commit induces the following warnings:
>
> In file included from /home/neilc/pgsql/src/timezone/localtime.c:20:
> /home/neilc/pgsql/src/timezone/private.h:107:9: warning: extra tokens at
> end of #undef directive
> In file included from /home/neilc/pgsql/src/timezone/strftime.c:27:
> /home/neilc/pgsql/src/timezone/private.h:107:9: warning: extra tokens at
> end of #undef directive
> In file included from /home/neilc/pgsql/src/timezone/zic.c:18:
> /home/neilc/pgsql/src/timezone/private.h:107:9: warning: extra tokens at
> end of #undef directive
> In file included from /home/neilc/pgsql/src/timezone/ialloc.c:11:
> /home/neilc/pgsql/src/timezone/private.h:107:9: warning: extra tokens at
> end of #undef directive
> In file included from /home/neilc/pgsql/src/timezone/scheck.c:11:
> /home/neilc/pgsql/src/timezone/private.h:107:9: warning: extra tokens at
> end of #undef directive
>
> -Neil
>

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
Index: src/pl/plperl/SPI.xs
===================================================================
RCS file: /cvsroot/pgsql/src/pl/plperl/SPI.xs,v
retrieving revision 1.12
diff -c -c -r1.12 SPI.xs
*** src/pl/plperl/SPI.xs    22 Feb 2005 04:42:44 -0000    1.12
--- src/pl/plperl/SPI.xs    22 Feb 2005 18:05:37 -0000
***************
*** 1,7 ****
  /* this must be first: */
  #include "postgres.h"
  /* Defined by Perl */
! #undef _(x)

  /* perl stuff */
  #include "EXTERN.h"
--- 1,7 ----
  /* this must be first: */
  #include "postgres.h"
  /* Defined by Perl */
! #undef _

  /* perl stuff */
  #include "EXTERN.h"
Index: src/pl/plperl/plperl.c
===================================================================
RCS file: /cvsroot/pgsql/src/pl/plperl/plperl.c,v
retrieving revision 1.68
diff -c -c -r1.68 plperl.c
*** src/pl/plperl/plperl.c    22 Feb 2005 04:42:44 -0000    1.68
--- src/pl/plperl/plperl.c    22 Feb 2005 18:05:37 -0000
***************
*** 39,45 ****

  #include "postgres.h"
  /* Defined by Perl */
! #undef _(x)

  /* system stuff */
  #include <ctype.h>
--- 39,45 ----

  #include "postgres.h"
  /* Defined by Perl */
! #undef _

  /* system stuff */
  #include <ctype.h>
Index: src/pl/plperl/spi_internal.c
===================================================================
RCS file: /cvsroot/pgsql/src/pl/plperl/spi_internal.c,v
retrieving revision 1.6
diff -c -c -r1.6 spi_internal.c
*** src/pl/plperl/spi_internal.c    22 Feb 2005 04:42:44 -0000    1.6
--- src/pl/plperl/spi_internal.c    22 Feb 2005 18:05:37 -0000
***************
*** 6,12 ****

  #include "postgres.h"
  /* Defined by Perl */
! #undef _(x)

  #include "spi_internal.h"

--- 6,12 ----

  #include "postgres.h"
  /* Defined by Perl */
! #undef _

  #include "spi_internal.h"

Index: src/timezone/private.h
===================================================================
RCS file: /cvsroot/pgsql/src/timezone/private.h,v
retrieving revision 1.10
diff -c -c -r1.10 private.h
*** src/timezone/private.h    22 Feb 2005 04:43:23 -0000    1.10
--- src/timezone/private.h    22 Feb 2005 18:05:38 -0000
***************
*** 104,110 ****
      ((TYPE_BIT(type) - TYPE_SIGNED(type)) * 302 / 1000 + 1 + TYPE_SIGNED(type))
  #endif   /* !defined INT_STRLEN_MAXIMUM */

! #undef _(x)
  #define _(msgid) (msgid)

  /*
--- 104,110 ----
      ((TYPE_BIT(type) - TYPE_SIGNED(type)) * 302 / 1000 + 1 + TYPE_SIGNED(type))
  #endif   /* !defined INT_STRLEN_MAXIMUM */

! #undef _
  #define _(msgid) (msgid)

  /*

pgsql-patches by date:

Previous
From: Neil Conway
Date:
Subject: Re: WIP: pl/pgsql cleanup
Next
From: Nicolai Tufar
Date:
Subject: Re: Repleacement for src/port/snprintf.c