Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit06dca17

Browse files
committed
Re-allow building on Microsoft Visual Studio 2013.
In commit450ee70 I supposed that all platforms we now care about havesnprintf(), since that's required by C99. Turns out that Microsoft didnot get around to adding that until VS2015. We've dropped support forVS2013 as of HEAD (cf6203583), but not in the back branches, so adda hack for this in the back branches only.There's no easy shortcut to an exact emulation of standard snprintfin VS2013, but fortunately we don't need one: this code was just finewith using sprintf before450ee70, so we can make it do so againon that platform (and any others where the problem might crop up).Per bug #17681 from Daisuke Higuchi. Back-patch to v12, like theprevious patch.Discussion:https://postgr.es/m/17681-485ba2ec13e7f392@postgresql.org
1 parentfc0d1ec commit06dca17

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

‎src/port/snprintf.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,16 @@
109109
#undefvprintf
110110
#undefprintf
111111

112+
/*
113+
* We use the platform's native snprintf() for some machine-dependent cases.
114+
* While that's required by C99, Microsoft Visual Studio lacks it before
115+
* VS2015. Fortunately, we don't really need the length check in practice,
116+
* so just fall back to native sprintf() on that platform.
117+
*/
118+
#if defined(_MSC_VER)&&_MSC_VER<1900/* pre-VS2015 */
119+
#definesnprintf(str,size,...) sprintf(str,__VA_ARGS__)
120+
#endif
121+
112122
/*
113123
* Info about where the formatted output is going.
114124
*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp