summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSergiu Dotenco <sergiu.dotenco@th-nuernberg.de>2015-03-26 14:59:00 (GMT)
committerSergiu Dotenco <sergiu.dotenco@gmail.com>2015-07-15 20:34:58 (GMT)
commitf9def39a465725c1b2a60f64200fba5d1614da36 (patch)
treee3fff3d2b7e91b2e2d234bfac12e72c3aca8a8f8 /src
parentfa4c5b50a9647af5ed22f874d090ea6b25176f78 (diff)
downloadglog-f9def39a465725c1b2a60f64200fba5d1614da36.zip
glog-f9def39a465725c1b2a60f64200fba5d1614da36.tar.gz
glog-f9def39a465725c1b2a60f64200fba5d1614da36.tar.bz2
do not redefine snprintf if it's already available
Diffstat (limited to 'src')
-rwxr-xr-xsrc/windows/port.cc2
-rwxr-xr-xsrc/windows/port.h8
2 files changed, 8 insertions, 2 deletions
diff --git a/src/windows/port.cc b/src/windows/port.cc
index bfa6e70..d994325 100755
--- a/src/windows/port.cc
+++ b/src/windows/port.cc
@@ -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
diff --git a/src/windows/port.h b/src/windows/port.h
index 24d7677..d78a185 100755
--- a/src/windows/port.h
+++ b/src/windows/port.h
@@ -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.