Skip site navigation (1) Skip section navigation (2)

Re: [pgsql-hackers-win32] snprintf causes regression tests

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Nicolai Tufar <ntufar(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>,Magnus Hagander <mha(at)sollentuna(dot)net>,PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>,PostgreSQL Win32 port list <pgsql-hackers-win32(at)postgresql(dot)org>
Subject: Re: [pgsql-hackers-win32] snprintf causes regression tests
Date: 2005-05-05 21:03:11
Message-ID: 200505052103.j45L3B500334@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-hackers-win32pgsql-patches
Andrew Dunstan wrote:
> 
> After some further digging, I think we have 3 problems.
> 
> 1. On Windows gettext wants to hijack printf and friends, as below. This
> strikes me as rather unfriendly behaviour by a library header file.
> Anyway, mercifully libintl.h is included in our source in exactly one
> spot, so I think the thing to do for this problem is a) undo that
> hijacking and b) make sure any hijacking we want to do occurs after the
> point where that file in included (in c.h). This causes most of the
> noise, but is probably harmless, since our hijacking does in fact win
> out. We need to fix the arnings, though.
> 
> 2. We have multiple #defines for snprintf and vsnprintf (in port.h and
> win32.h).
> 
> 3. ecpg wants to use our pg*printf routines (because USE_SNPRINTF is
> defined) but doesn't know where to find them.
> 
> what a mess :-(

Based on the "mess" analysis, I decided it is better to allow libintl to
use its own snprintf() for Win32 when NLS is enabled, rather than try to
override that with our own snprintf.  I have added code to configure.in
so that we don't check for arg control in native snprintf on Win32
because when we are using NLS, we are going to get their snprintf anyway
and not the native one.

Patch attached and applied.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

In response to

pgsql-hackers by date

Next:From: Marc G. FournierDate: 2005-05-05 21:10:32
Subject: Re: [pgsql-advocacy] Increased company involvement
Previous:From: Tom LaneDate: 2005-05-05 21:01:47
Subject: Re: performance of bitmap scans in nested loop joins

pgsql-patches by date

Next:From: Tom LaneDate: 2005-05-06 00:55:24
Subject: Re: Cleaning up unreferenced table files
Previous:From: Marko KreenDate: 2005-05-05 13:33:49
Subject: entab vs. gcc4 again

pgsql-hackers-win32 by date

Next:From: Magnus HaganderDate: 2005-05-09 17:54:03
Subject: Re: postgresql-8.0-int.msi
Previous:From: Magnus HaganderDate: 2005-05-05 11:39:49
Subject: Re: Install Question

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group