Bug 93116 - Additional _MSVC version check needed in config.h because of snprintf
Summary: Additional _MSVC version check needed in config.h because of snprintf
Status: RESOLVED FIXED
Alias: None
Product: poppler
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: All Windows (All)
: medium normal
Assignee: poppler-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-26 10:51 UTC by Julian Rehborn
Modified: 2015-11-28 21:38 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Julian Rehborn 2015-11-26 10:51:48 UTC
Currently "config.h" looks like this.

/* MS has defined snprintf as deprecated */
#ifdef _MSC_VER
#define snprintf _snprintf
#endif

snprintf is now implemented by Microsoft with MSVC14/Win10SDK in "sdtio.h" compiling fails because "stdio.h" contains a check if snprintf is defined previous.

"config.h" should look like.

 /* MS has defined snprintf as deprecated, but MSVC14/Win10SDK implements it again. */
#ifdef _MSC_VER && _MSC_VER <= 1800
#define snprintf _snprintf
#endif
Comment 1 Adrian Johnson 2015-11-26 11:15:35 UTC
Shouldn't that be 

#if defined(_MSC_VER) && _MSC_VER <= 1800

Probably better to compare against the version that introduced snprint. ie

#if defined(_MSC_VER) && _MSC_VER < 1900
Comment 2 Albert Astals Cid 2015-11-26 22:58:55 UTC
Adree with Adrian.

Adrian can you please commit it?
Comment 3 Adrian Johnson 2015-11-28 21:38:29 UTC
committed


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.