Re: BUG #17681: Building the REL_12_13 source in Visual Studio 2013 fails.

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: "Daisuke Higuchi (Fujitsu)" <higuchi.daisuke@fujitsu.com>
Cc: "pgsql-bugs@lists.postgresql.org" <pgsql-bugs@lists.postgresql.org>
Date: 2022-11-10T15:24:43Z
Lists: pgsql-bugs
"Daisuke Higuchi (Fujitsu)" <higuchi.daisuke@fujitsu.com> writes:
>> #if defined(_MSC_VER) && _MSC_VER < 1900   /* pre-VS2015 */
>> #define snprintf(str,size,...) sprintf(str,__VA_ARGS__)
>> #endif
>> in snprintf.c below where it #undef's snprintf.  Could you try that and verify it works for you?

> Thank you! I verified this fix works correctly.
> I confirmed that it succeeded to build the source of REL_12_13 + this fix in Visual Studio 2013.

Excellent.  Fix pushed.

			regards, tom lane



Commits

  1. Re-allow building on Microsoft Visual Studio 2013.

  2. Use libc's snprintf, not sprintf, for special cases in snprintf.c.