Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
G
gflags
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
gflags
Commits
366e9d33
Commit
366e9d33
authored
Dec 31, 2015
by
Sergey Sharybin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some compilation warnings with MSVC 2015
MSVC 2015 already defines vsnprintf() and va_copy().
parent
4f100cb6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
windows_port.cc
src/windows_port.cc
+2
-4
windows_port.h
src/windows_port.h
+2
-0
No files found.
src/windows_port.cc
View file @
366e9d33
...
...
@@ -44,6 +44,7 @@
// These call the windows _vsnprintf, but always NUL-terminate.
#if !defined(__MINGW32__) && !defined(__MINGW64__)
/* mingw already defines */
#if !(defined(_MSC_VER) && _MSC_VER >= 1900)
/* msvc 2015 already defines */
#ifdef _MSC_VER
# pragma warning(push)
...
...
@@ -59,8 +60,6 @@ int safe_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
# pragma warning(pop)
#endif
#if _MSC_VER < 1900 // msvs 2015 finally includes snprintf
int
snprintf
(
char
*
str
,
size_t
size
,
const
char
*
format
,
...)
{
int
r
;
va_list
ap
;
...
...
@@ -70,6 +69,5 @@ int snprintf(char *str, size_t size, const char *format, ...) {
return
r
;
}
#endif
#endif
/* if !(defined(_MSC_VER) && _MSC_VER >= 1900) */
#endif
/* #if !defined(__MINGW32__) && !defined(__MINGW64__) */
src/windows_port.h
View file @
366e9d33
...
...
@@ -63,12 +63,14 @@
* name vsnprintf, since windows defines that (but not snprintf (!)).
*/
#if !defined(__MINGW32__) && !defined(__MINGW64__)
/* mingw already defines */
#if !(defined(_MSC_VER) && _MSC_VER >= 1900)
/* msvc 2015 already defines */
extern
GFLAGS_DLL_DECL
int
snprintf
(
char
*
str
,
size_t
size
,
const
char
*
format
,
...);
extern
int
GFLAGS_DLL_DECL
safe_vsnprintf
(
char
*
str
,
size_t
size
,
const
char
*
format
,
va_list
ap
);
#define vsnprintf(str, size, format, ap) safe_vsnprintf(str, size, format, ap)
#define va_copy(dst, src) (dst) = (src)
#endif
#endif
/* #if !defined(__MINGW32__) && !defined(__MINGW64__) */
#ifdef _MSC_VER
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment