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

From: "Hiroshi Saito" <z-saito(at)guitar(dot)ocn(dot)ne(dot)jp>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: More #ifdef fun: src/interfaces/libpq/win32.c
Date: 2006-07-16 00:14:45
Message-ID: 02e601c6a86c$d7b649a0$0801a8c0@IBMC4B5932F74B
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Hi Tom-san.

I think that it should be in this way.

#include "postgres_fe.h"
#ifdef WIN32
#include "win32.h"
#endif

However, I am still under try by the reason for seeing the error of now a few.

Regards,
Hiroshi Saito

----- Original Message -----
From: "Tom Lane"

> 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.
>
> regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2006-07-16 00:58:04 Re: automatic system info tool?
Previous Message Hiroshi Saito 2006-07-16 00:07:23 PostmasterHandl_patch of win32

Browse pgsql-patches by date

  From Date Subject
Next Message Andrew Dunstan 2006-07-16 00:21:03 Re: Have psql display names and OUT/INOUT in \df output
Previous Message Hiroshi Saito 2006-07-16 00:07:23 PostmasterHandl_patch of win32