Re: [HACKERS] More #ifdef fun: src/interfaces/libpq/win32.c

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] More #ifdef fun: src/interfaces/libpq/win32.c
Date: 2006-07-29 15:21:44
Message-ID: 200607291521.k6TFLiB12035@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Tom Lane wrote:
> src/interfaces/libpq/win32.c contains
>
> /* Declared here to avoid pulling in all includes, which causes name collissions */
> #ifdef ENABLE_NLS
> extern char *
> libpq_gettext(const char *msgid)
> __attribute__((format_arg(1)));
> #else
> #define libpq_gettext(x) (x)
> #endif
>
> Now, since it has nowhere bothered to #include pg_config.h, ENABLE_NLS
> will certainly not be defined, and so this code always fails to invoke
> gettext.
>
> This may not be real important since the file appears to use gettext
> only here:
>
> if (!success)
> sprintf(strerrbuf, libpq_gettext("Unknown socket error (0x%08X/%i)"), err, err);
>
> but it's still pretty bogus.
>
> Without a Windows machine, I'm not in a position to try making this file
> properly include postgres_fe.h, or at least c.h, but someone ought to
> try harder.

I have applied the following patch to include postgres_fe.h in two
win32-specific files. I think the authors thought where was no
pg-specific code in there, but now there is, or might be in the future.
I see no reason to backpatch this.

--
Bruce Momjian bruce(at)momjian(dot)us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

Attachment Content-Type Size
/bjm/diff text/x-diff 1.3 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Joshua D. Drake 2006-07-29 15:33:00 Re: pgindet ^M
Previous Message Andrew Dunstan 2006-07-29 14:57:57 Re: pgindet ^M

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2006-07-29 17:15:18 Re: [HACKERS] putting CHECK_FOR_INTERRUPTS in
Previous Message Andrew Dunstan 2006-07-29 14:21:05 Re: [HACKERS] Possible explanation for Win32 stats regression