Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
G
glog
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
glog
Commits
f9def39a
Commit
f9def39a
authored
Mar 26, 2015
by
Sergiu Dotenco
Committed by
Sergiu Dotenco
Jul 15, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
do not redefine snprintf if it's already available
parent
fa4c5b50
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
port.cc
src/windows/port.cc
+2
-0
port.h
src/windows/port.h
+6
-2
No files found.
src/windows/port.cc
View file @
f9def39a
...
...
@@ -55,6 +55,7 @@ int safe_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
return
_vsnprintf
(
str
,
size
-
1
,
format
,
ap
);
}
#ifndef HAVE_SNPRINTF
int
snprintf
(
char
*
str
,
size_t
size
,
const
char
*
format
,
...)
{
va_list
ap
;
va_start
(
ap
,
format
);
...
...
@@ -62,3 +63,4 @@ int snprintf(char *str, size_t size, const char *format, ...) {
va_end
(
ap
);
return
r
;
}
#endif
src/windows/port.h
View file @
f9def39a
...
...
@@ -111,12 +111,16 @@ enum { STDIN_FILENO = 0, STDOUT_FILENO = 1, STDERR_FILENO = 2 };
* because they don't always NUL-terminate. :-( We also can't use the
* name vsnprintf, since windows defines that (but not snprintf (!)).
*/
extern
int
snprintf
(
char
*
str
,
size_t
size
,
#ifndef HAVE_SNPRINTF
extern
int
GOOGLE_GLOG_DLL_DECL
snprintf
(
char
*
str
,
size_t
size
,
const
char
*
format
,
...);
extern
int
safe_vsnprintf
(
char
*
str
,
size_t
size
,
#endif
extern
int
GOOGLE_GLOG_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)
#ifndef va_copy
#define va_copy(dst, src) (dst) = (src)
#endif
/* Windows doesn't support specifying the number of buckets as a
* hash_map constructor arg, so we leave this blank.
...
...
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