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

higuchi.daisuke@fujitsu.com <higuchi.daisuke@fujitsu.com>

From: "Daisuke Higuchi (Fujitsu)" <higuchi.daisuke@fujitsu.com>
To: 'Tom Lane' <tgl@sss.pgh.pa.us>
Cc: "pgsql-bugs@lists.postgresql.org" <pgsql-bugs@lists.postgresql.org>
Date: 2022-11-10T01:27:55Z
Lists: pgsql-bugs
>#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.

Regards,
Higuchi



Commits

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

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