CVS of 8.1.x MS-VC6 probrem.

Started by Hiroshi Saitoover 20 years ago17 messagespatches
Jump to latest
#1Hiroshi Saito
z-saito@guitar.ocn.ne.jp

Dear Bruce san.

I reconfirmed MS-VC6. Thank you for wonderful correspondence.
However, Another problem newly occurred.
This solves the problem of snprintf and vsnprintf.
Please apply it.

Thank you.

Regards,
Hiroshi Saito

Attachments:

postgresql-8.1.1_vc6_patch.txttext/plain; name=postgresql-8.1.1_vc6_patch.txtDownload+6-0
#2Bruce Momjian
bruce@momjian.us
In reply to: Hiroshi Saito (#1)
Re: CVS of 8.1.x MS-VC6 probrem.

That code was removed when *printf was fixed, and we thought it wasn't
needed anumore. Thanks for the quick report.

Patch applied to CVS HEAD and 8.1.X.

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

Hiroshi Saito wrote:

Dear Bruce san.

I reconfirmed MS-VC6. Thank you for wonderful correspondence.
However, Another problem newly occurred.
This solves the problem of snprintf and vsnprintf.
Please apply it.

Thank you.

Regards,
Hiroshi Saito

[ Attachment, skipping... ]

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

-- 
  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
#3Bruce Momjian
bruce@momjian.us
In reply to: Bruce Momjian (#2)
Re: CVS of 8.1.x MS-VC6 probrem.

While I have applied your patch, I am now confused about something. Your
change was to pg_config.h.win32, which is used only for
WIN32_CLIENT_ONLY compiles, namely MSVC and Borland C.

The addition was:

/* use _snprintf and _vsnprintf */
#define HAVE_DECL_SNPRINTF 1
#define snprintf _snprintf
#define HAVE_DECL_VSNPRINTF 1
#define vsnprintf _vsnprintf

Now, I think the problem is that with those defines, we will not use our
port/snprintf.c, meaning the %$ escapes for language translation will
not work for those builds. I realize the backend is the most important
for messages, but libpq and psql also have message translation.

Would you try removing those lines you added and add these to
pg_config.h.win32:

#define HAVE_DECL_SNPRINTF 1
#define HAVE_DECL_VSNPRINTF 1
#define HAVE_SNPRINTF 1
#define HAVE_VSNPRINTF 1
#define USE_REPL_SNPRINTF 1

Does that allow it to compile? We have limited time before 8.1.1 is
packaged.

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

pgman wrote:

That code was removed when *printf was fixed, and we thought it wasn't
needed anumore. Thanks for the quick report.

Patch applied to CVS HEAD and 8.1.X.

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

Hiroshi Saito wrote:

Dear Bruce san.

I reconfirmed MS-VC6. Thank you for wonderful correspondence.
However, Another problem newly occurred.
This solves the problem of snprintf and vsnprintf.
Please apply it.

Thank you.

Regards,
Hiroshi Saito

[ Attachment, skipping... ]

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

-- 
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
-- 
  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
#4Bruce Momjian
bruce@momjian.us
In reply to: Bruce Momjian (#3)
Re: CVS of 8.1.x MS-VC6 probrem.

Also, if my suggested changes do not allow it to compile, please show us
the compile error message with my suggested changes. Thanks.

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

Bruce Momjian wrote:

While I have applied your patch, I am now confused about something. Your
change was to pg_config.h.win32, which is used only for
WIN32_CLIENT_ONLY compiles, namely MSVC and Borland C.

The addition was:

/* use _snprintf and _vsnprintf */
#define HAVE_DECL_SNPRINTF 1
#define snprintf _snprintf
#define HAVE_DECL_VSNPRINTF 1
#define vsnprintf _vsnprintf

Now, I think the problem is that with those defines, we will not use our
port/snprintf.c, meaning the %$ escapes for language translation will
not work for those builds. I realize the backend is the most important
for messages, but libpq and psql also have message translation.

Would you try removing those lines you added and add these to
pg_config.h.win32:

#define HAVE_DECL_SNPRINTF 1
#define HAVE_DECL_VSNPRINTF 1
#define HAVE_SNPRINTF 1
#define HAVE_VSNPRINTF 1
#define USE_REPL_SNPRINTF 1

Does that allow it to compile? We have limited time before 8.1.1 is
packaged.

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

pgman wrote:

That code was removed when *printf was fixed, and we thought it wasn't
needed anumore. Thanks for the quick report.

Patch applied to CVS HEAD and 8.1.X.

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

Hiroshi Saito wrote:

Dear Bruce san.

I reconfirmed MS-VC6. Thank you for wonderful correspondence.
However, Another problem newly occurred.
This solves the problem of snprintf and vsnprintf.
Please apply it.

Thank you.

Regards,
Hiroshi Saito

[ Attachment, skipping... ]

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

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

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

-- 
  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
#5Hiroshi Saito
z-saito@guitar.ocn.ne.jp
In reply to: Bruce Momjian (#4)
Re: CVS of 8.1.x MS-VC6 probrem.

Dear Bruce-san.

#define HAVE_DECL_SNPRINTF 1
#define HAVE_DECL_VSNPRINTF 1
#define HAVE_SNPRINTF 1
#define HAVE_VSNPRINTF 1
#define USE_REPL_SNPRINTF 1

Ummm...
This causes injustice.
----------------------------------------------------------------------------------------------
libpq.lib(fe-connect.obj) : error LNK2001: 外部シンボル "_pg_snprintf" は未解決です

libpq.lib(getaddrinfo.obj) : error LNK2001: 外部シンボル "_pg_snprintf" は未解決で

libpq.lib(fe-auth.obj) : error LNK2001: 外部シンボル "_pg_snprintf" は未解決です
libpq.lib(win32.obj) : error LNK2001: 外部シンボル "_pg_sprintf" は未解決です
libpq.lib(fe-connect.obj) : error LNK2001: 外部シンボル "_pg_sprintf" は未解決です
libpq.lib(fe-exec.obj) : error LNK2001: 外部シンボル "_pg_sprintf" は未解決です
libpq.lib(fe-print.obj) : error LNK2001: 外部シンボル "_pg_sprintf" は未解決です
libpq.lib(fe-protocol2.obj) : error LNK2001: 外部シンボル "_pg_sprintf" は未解決で

libpq.lib(encnames.obj) : error LNK2001: 外部シンボル "_pg_fprintf" は未解決です
libpq.lib(fe-auth.obj) : error LNK2001: 外部シンボル "_pg_fprintf" は未解決です
libpq.lib(fe-connect.obj) : error LNK2001: 外部シンボル "_pg_fprintf" は未解決です
libpq.lib(fe-exec.obj) : error LNK2001: 外部シンボル "_pg_fprintf" は未解決です
libpq.lib(fe-print.obj) : error LNK2001: 外部シンボル "_pg_fprintf" は未解決です
libpq.lib(fe-misc.obj) : error LNK2001: 外部シンボル "_pg_fprintf" は未解決です
libpq.lib(fe-exec.obj) : error LNK2001: 外部シンボル "_pg_vsnprintf" は未解決です
libpq.lib(pqexpbuffer.obj) : error LNK2001: 外部シンボル "_pg_vsnprintf" は未解決で

.\Release\libpq.dll : fatal error LNK1120: 外部参照 4 が未解決です。
NMAKE : fatal error U1077: 'link.exe' : リターン コード '0x460'

#6Hiroshi Saito
z-saito@guitar.ocn.ne.jp
In reply to: Bruce Momjian (#3)
Re: CVS of 8.1.x MS-VC6 probrem.

for messages, but libpq and psql also have message translation.

The work of using port/snprintf is needed.
and If gettext is used....
Is it desired now? It will be tonight if it becomes so.

Regards,
Hiroshi Saito

#7Magnus Hagander
magnus@hagander.net
In reply to: Hiroshi Saito (#6)
Re: CVS of 8.1.x MS-VC6 probrem.

While I have applied your patch, I am now confused about
something. Your change was to pg_config.h.win32, which is
used only for WIN32_CLIENT_ONLY compiles, namely MSVC and Borland C.

The addition was:

/* use _snprintf and _vsnprintf */
#define HAVE_DECL_SNPRINTF 1
#define snprintf _snprintf
#define HAVE_DECL_VSNPRINTF 1
#define vsnprintf _vsnprintf

Now, I think the problem is that with those defines, we will
not use our port/snprintf.c, meaning the %$ escapes for
language translation will not work for those builds. I
realize the backend is the most important for messages, but
libpq and psql also have message translation.

AFAIK we don't support NLS builds with MSVC anyway. (Check
pg_config.h.win32, it has no #define NLS). So I don't think this is an
issue.

//Magnus

#8Hiroshi Saito
z-saito@guitar.ocn.ne.jp
In reply to: Magnus Hagander (#7)
Re: CVS of 8.1.x MS-VC6 probrem.

Hi Magnus.

libpq and psql also have message translation.

AFAIK we don't support NLS builds with MSVC anyway. (Check
pg_config.h.win32, it has no #define NLS). So I don't think this is an
issue.

Um, I agree with you. Probably, Bruce san is also noticed.
I thought that Bruce san suggested the evolution.
However, I think that the plan is now difficult for 8.1.1.

Regards,
Hiroshi Saito

#9Magnus Hagander
magnus@hagander.net
In reply to: Hiroshi Saito (#8)
Re: CVS of 8.1.x MS-VC6 probrem.

libpq and psql also have message translation.

AFAIK we don't support NLS builds with MSVC anyway. (Check
pg_config.h.win32, it has no #define NLS). So I don't think

this is an

issue.

Um, I agree with you. Probably, Bruce san is also noticed.
I thought that Bruce san suggested the evolution.
However, I think that the plan is now difficult for 8.1.1.

I definitly don't think we should try to *add* NLS support in
8.1.1.That's very much a new feature, and not a very simple one either.
Possibly for 8.2, if someone wants to do the legwork.

//Magnus

#10Tom Lane
tgl@sss.pgh.pa.us
In reply to: Hiroshi Saito (#8)
Re: CVS of 8.1.x MS-VC6 probrem.

"Hiroshi Saito" <saito@inetrt.skcapi.co.jp> writes:

AFAIK we don't support NLS builds with MSVC anyway. (Check
pg_config.h.win32, it has no #define NLS). So I don't think this is an
issue.

Um, I agree with you. Probably, Bruce san is also noticed.
I thought that Bruce san suggested the evolution.
However, I think that the plan is now difficult for 8.1.1.

Yeah. I had hoped the client-only build would "just work" with the
snprintf changes, but if not there is no time to make it work for 8.1.1.
I would like to revisit this for 8.1.2 or 8.2, though. It would be
good to have NLS support in the client-only build, if we intend to keep
supporting that at all.

regards, tom lane

#11Dave Page
dpage@pgadmin.org
In reply to: Tom Lane (#10)
Re: CVS of 8.1.x MS-VC6 probrem.

-----Original Message-----
From: pgsql-patches-owner@postgresql.org
[mailto:pgsql-patches-owner@postgresql.org] On Behalf Of Tom Lane
Sent: 09 December 2005 14:01
To: Hiroshi Saito
Cc: Magnus Hagander; Bruce Momjian; PostgreSQL-patches
Subject: Re: [PATCHES] CVS of 8.1.x MS-VC6 probrem.

"Hiroshi Saito" <saito@inetrt.skcapi.co.jp> writes:

AFAIK we don't support NLS builds with MSVC anyway. (Check
pg_config.h.win32, it has no #define NLS). So I don't

think this is an

issue.

Um, I agree with you. Probably, Bruce san is also noticed.
I thought that Bruce san suggested the evolution.
However, I think that the plan is now difficult for 8.1.1.

Yeah. I had hoped the client-only build would "just work" with the
snprintf changes, but if not there is no time to make it work
for 8.1.1.
I would like to revisit this for 8.1.2 or 8.2, though. It would be
good to have NLS support in the client-only build, if we
intend to keep
supporting that at all.

As one of the people who has had the joy of maintaining this in the
past, I wanted to drop it as you may remember but that was rejected on
the basis that someone somewhere might want to use their own VC++ build
over our precompiled versions for some reason.

Now that there is a project on pgFoundry allowing builds of the entire
server using VC++, perhaps we should rethink that decision?

Regards, Dave

#12Tom Lane
tgl@sss.pgh.pa.us
In reply to: Dave Page (#11)
Re: CVS of 8.1.x MS-VC6 probrem.

"Dave Page" <dpage@vale-housing.co.uk> writes:

As one of the people who has had the joy of maintaining this in the
past, I wanted to drop it as you may remember but that was rejected on
the basis that someone somewhere might want to use their own VC++ build
over our precompiled versions for some reason.

Now that there is a project on pgFoundry allowing builds of the entire
server using VC++, perhaps we should rethink that decision?

I recall wanting to drop it too. Wasn't the argument about whether the
libpq.dll we produce would work nicely in a VC++ project? If it does,
then I'm willing to push the problem off to the pgFoundry project.

(Of course that would be a change for 8.2, not something we should drop
in existing branches.)

regards, tom lane

#13Hiroshi Saito
z-saito@guitar.ocn.ne.jp
In reply to: Magnus Hagander (#7)
Re: CVS of 8.1.x MS-VC6 probrem.

Dear tom san.

Thank you for suggestion.

Yeah. I had hoped the client-only build would "just work" with the
snprintf changes, but if not there is no time to make it work for 8.1.1.
I would like to revisit this for 8.1.2 or 8.2, though. It would be
good to have NLS support in the client-only build, if we intend to keep
supporting that at all.

regards, tom lane

Actually, it is possible by only replacing DLL of making MSVC of now with
DLL of MinGW now. I think that I am satisfactory by MSVC DLL of the
present simple structure. Isn't it satisfied only with explaining of it?
It will be satisfied if simple MSVC is provided with compile environment.
Otherwise, even kerberos5 is possible. However, I vote for Magnus.

Regards,
Hiroshi Saito

#14Dave Page
dpage@pgadmin.org
In reply to: Hiroshi Saito (#13)
Re: CVS of 8.1.x MS-VC6 probrem.

-----Original Message-----
From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
Sent: 09 December 2005 14:33
To: Dave Page
Cc: Hiroshi Saito; Magnus Hagander; Bruce Momjian; PostgreSQL-patches
Subject: Re: [PATCHES] CVS of 8.1.x MS-VC6 probrem.

"Dave Page" <dpage@vale-housing.co.uk> writes:

As one of the people who has had the joy of maintaining this in the
past, I wanted to drop it as you may remember but that was

rejected on

the basis that someone somewhere might want to use their

own VC++ build

over our precompiled versions for some reason.

Now that there is a project on pgFoundry allowing builds of

the entire

server using VC++, perhaps we should rethink that decision?

I recall wanting to drop it too. Wasn't the argument about
whether the
libpq.dll we produce would work nicely in a VC++ project? If it does,
then I'm willing to push the problem off to the pgFoundry project.

It works perfectly well - pgAdmin is built with VC++ on windows for
example, as is psqlODBC.

(Of course that would be a change for 8.2, not something we
should drop
in existing branches.)

Goes without saying doesn't it? :-)

Regards, Dave

#15Bruce Momjian
bruce@momjian.us
In reply to: Hiroshi Saito (#6)
Re: CVS of 8.1.x MS-VC6 probrem.

Hiroshi Saito wrote:

for messages, but libpq and psql also have message translation.

The work of using port/snprintf is needed.
and If gettext is used....
Is it desired now? It will be tonight if it becomes so.

Sorry, I only realized after I was in bed that we don't use libintl with
the WIN32_CLIENT_ONLY builds, so your applied patch is correct and we
can move ahead with 8.1.1. I think the only question now is whether it
is OK to have MinGW builds using our snprintf.c and WIN32_CLIENT_ONLY
builds using the operating system version, but I assume it will be OK.

-- 
  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
#16Bruce Momjian
bruce@momjian.us
In reply to: Magnus Hagander (#7)
Re: CVS of 8.1.x MS-VC6 probrem.

Magnus Hagander wrote:

While I have applied your patch, I am now confused about
something. Your change was to pg_config.h.win32, which is
used only for WIN32_CLIENT_ONLY compiles, namely MSVC and Borland C.

The addition was:

/* use _snprintf and _vsnprintf */
#define HAVE_DECL_SNPRINTF 1
#define snprintf _snprintf
#define HAVE_DECL_VSNPRINTF 1
#define vsnprintf _vsnprintf

Now, I think the problem is that with those defines, we will
not use our port/snprintf.c, meaning the %$ escapes for
language translation will not work for those builds. I
realize the backend is the most important for messages, but
libpq and psql also have message translation.

AFAIK we don't support NLS builds with MSVC anyway. (Check
pg_config.h.win32, it has no #define NLS). So I don't think this is an
issue.

Right, thanks. Sorry for the confusion.

-- 
  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
#17Bruce Momjian
bruce@momjian.us
In reply to: Magnus Hagander (#9)
Re: CVS of 8.1.x MS-VC6 probrem.

Magnus Hagander wrote:

libpq and psql also have message translation.

AFAIK we don't support NLS builds with MSVC anyway. (Check
pg_config.h.win32, it has no #define NLS). So I don't think

this is an

issue.

Um, I agree with you. Probably, Bruce san is also noticed.
I thought that Bruce san suggested the evolution.
However, I think that the plan is now difficult for 8.1.1.

I definitly don't think we should try to *add* NLS support in
8.1.1.That's very much a new feature, and not a very simple one either.
Possibly for 8.2, if someone wants to do the legwork.

Agreed.

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