summaryrefslogtreecommitdiffstats
path: root/src/H5system.c
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2013-07-01 14:23:04 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2013-07-01 14:23:04 (GMT)
commit53afd20aeb09fb2565811cc3dbf22890f0fcf900 (patch)
treef4d7a807515ed9c4f39fc7302824c55155cc9c0a /src/H5system.c
parenta157eb2f689d873a53e96cfc486db423658c7902 (diff)
downloadhdf5-53afd20aeb09fb2565811cc3dbf22890f0fcf900.zip
hdf5-53afd20aeb09fb2565811cc3dbf22890f0fcf900.tar.gz
hdf5-53afd20aeb09fb2565811cc3dbf22890f0fcf900.tar.bz2
[svn-r23854] HDFFV-8302: Add macros/code function to use coorect Windows (v)snprintf statement. Also fix use other uses of macros for windows.
Tested
Diffstat (limited to 'src/H5system.c')
-rw-r--r--src/H5system.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/H5system.c b/src/H5system.c
index a93a128..85e554e 100644
--- a/src/H5system.c
+++ b/src/H5system.c
@@ -666,6 +666,30 @@ Wgetlogin()
return NULL;
}
+int c99_snprintf(char* str, size_t size, const char* format, ...)
+{
+ int count;
+ va_list ap;
+
+ va_start(ap, format);
+ count = c99_vsnprintf(str, size, format, ap);
+ va_end(ap);
+
+ return count;
+}
+
+int c99_vsnprintf(char* str, size_t size, const char* format, va_list ap)
+{
+ int count = -1;
+
+ if (size != 0)
+ count = _vsnprintf_s(str, size, _TRUNCATE, format, ap);
+ if (count == -1)
+ count = _vscprintf(format, ap);
+
+ return count;
+}
+
#endif