RE: BUG #15080: ecpg on windows doesn't define HAVE_LONG_LONG_INT

Jonathan Allen <jallen@americansavingslife.com>

From: Jonathan Allen <jallen@americansavingslife.com>
To: Tom Lane <tgl@sss.pgh.pa.us>, Michael Meskes <meskes@postgresql.org>
Cc: Andrew Gierth <andrew@tao11.riddles.org.uk>, "pgsql-bugs@lists.postgresql.org" <pgsql-bugs@lists.postgresql.org>
Date: 2018-02-26T18:28:12Z
Lists: pgsql-bugs
Right now I'm using a custom build of ecpg to enable Bigint support, but it would suuuuure be nice to have that working in the next release of postgres.  I agree, all that's missing is the #define HAVE_LONG_LONG_INT 1 line. :)

-Jonathan

-----Original Message-----
From: Tom Lane [mailto:tgl@sss.pgh.pa.us] 
Sent: Saturday, February 24, 2018 1:12 PM
To: Michael Meskes <meskes@postgresql.org>
Cc: Andrew Gierth <andrew@tao11.riddles.org.uk>; Jonathan Allen <jallen@americansavingslife.com>; pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15080: ecpg on windows doesn't define HAVE_LONG_LONG_INT

I wrote:
> Michael Meskes <meskes@postgresql.org> writes:
>> Right, but it is missing in pg_config.h, too, right?

> No, it does get defined on Unix builds (if appropriate), both in 
> pg_config.h and ecpg_config.h.

Oh, wait, now I see what you meant: there is no stanza like

#if (_MSC_VER > 1200)
#define HAVE_LONG_LONG_INT 1
#endif

in pg_config.h.win32.  I agree that there should be.  As I said, none of the core backend cares at the moment ... but someday, that discrepancy is going to bite us.

			regards, tom lane


Commits

  1. Remove configure's check for nonstandard "long long" printf modifiers.

  2. printf("%lf") is not portable, so omit the "l".

  3. Support platforms where strtoll/strtoull are spelled __strtoll/__strtoull.

  4. Arrange to supply declarations for strtoll/strtoull if needed.

  5. Hot-fix ecpg regression test for missing ecpg_config.h inclusion.

  6. Add some test coverage for ecpg's "long long" support.

  7. Recognize that MSVC can support strtoll() and strtoull().

  8. Fix up ecpg's configuration so it handles "long long int" in MSVC builds.