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

Andrew Gierth <andrew@tao11.riddles.org.uk>

From: Andrew Gierth <andrew@tao11.riddles.org.uk>
To: Michael Meskes <meskes@postgresql.org>
Cc: jallen@americansavingslife.com, pgsql-bugs@lists.postgresql.org
Date: 2018-02-24T19:09:15Z
Lists: pgsql-bugs
>>>>> "Michael" == Michael Meskes <meskes@postgresql.org> writes:

 Michael> ECPG does not use pg_config.h, try making your change in
 Michael> ecpg_config.h instead.

Aha.

Solution.pm has this:

	if (IsNewer(
			'src/interfaces/ecpg/include/ecpg_config.h',
			'src/interfaces/ecpg/include/ecpg_config.h.in'))
	{
		print "Generating ecpg_config.h...\n";
		open(my $o, '>', 'src/interfaces/ecpg/include/ecpg_config.h')
		  || confess "Could not open ecpg_config.h";
		print $o <<EOF;
#if (_MSC_VER > 1200)
#define HAVE_LONG_LONG_INT_64 1
#define ENABLE_THREAD_SAFETY 1
EOF
		print $o "#endif\n";
		close($o);
	}

from which HAVE_LONG_LONG_INT seems to be suspiciously missing?

-- 
Andrew (irc:RhodiumToad)


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.