summaryrefslogtreecommitdiffstats
path: root/Utilities
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2005-12-30 22:27:57 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2005-12-30 22:27:57 (GMT)
commitc09548b50e908e1357dd2001a36584d12344eabc (patch)
tree4e90d4a990e4af93a72651c8fcb9b9940b993d4e /Utilities
parent6534e66e61975903c554c2b751c0d2761e4fe181 (diff)
downloadCMake-c09548b50e908e1357dd2001a36584d12344eabc.zip
CMake-c09548b50e908e1357dd2001a36584d12344eabc.tar.gz
CMake-c09548b50e908e1357dd2001a36584d12344eabc.tar.bz2
COMP: Fix support for vsnprintf
Diffstat (limited to 'Utilities')
-rw-r--r--Utilities/cmtar/CMakeLists.txt5
-rw-r--r--Utilities/cmtar/compat/compat.h8
-rw-r--r--Utilities/cmtar/compat/snprintf.c3
-rw-r--r--Utilities/cmtar/config.h.in5
4 files changed, 14 insertions, 7 deletions
diff --git a/Utilities/cmtar/CMakeLists.txt b/Utilities/cmtar/CMakeLists.txt
index 016173f..6b8f4b6 100644
--- a/Utilities/cmtar/CMakeLists.txt
+++ b/Utilities/cmtar/CMakeLists.txt
@@ -97,6 +97,7 @@ FOREACH(func
strsep
strdup
strftime
+ vsnprintf
glob
)
CHECK_SYMBOL_EXISTS_EX("${func}")
@@ -312,10 +313,10 @@ SET(NEED_STRMODE 1)
ENDIF(NOT HAVE_STRMODE)
IF(WIN32)
-IF(NOT HAVE_SNPRINTF)
+IF(NOT HAVE_SNPRINTF OR NOT HAVE_VSNPRINTF)
SET(libtar_SRC ${libtar_SRC} compat/snprintf.c)
SET(NEED_SNPRINTF 1)
-ENDIF(NOT HAVE_SNPRINTF)
+ENDIF(NOT HAVE_SNPRINTF OR NOT HAVE_VSNPRINTF)
ENDIF(WIN32)
IF(NOT HAVE_DIRNAME)
diff --git a/Utilities/cmtar/compat/compat.h b/Utilities/cmtar/compat/compat.h
index a42c06f..471bcad 100644
--- a/Utilities/cmtar/compat/compat.h
+++ b/Utilities/cmtar/compat/compat.h
@@ -201,10 +201,12 @@ int inet_aton(const char *, struct in_addr *);
#ifdef _MSC_VER /* compile snprintf only onwin32 */
#if !defined(HAVE_SNPRINTF)
int mutt_snprintf(char *, size_t, const char *, ...);
-int mutt_vsnprintf(char *, size_t, const char *, va_list);
-#define snprintf mutt_snprintf
-#define vsnprintf mutt_vsnprintf
+# define snprintf mutt_snprintf
+#endif
+#if !defined(HAVE_VSNPRINTF)
+int mutt_vsnprintf(char *, size_t, const char *, va_list);
+# define vsnprintf mutt_vsnprintf
#endif /* NEED_SNPRINTF && ! HAVE_SNPRINTF */
#endif
diff --git a/Utilities/cmtar/compat/snprintf.c b/Utilities/cmtar/compat/snprintf.c
index 24a17500..fbdf7c5 100644
--- a/Utilities/cmtar/compat/snprintf.c
+++ b/Utilities/cmtar/compat/snprintf.c
@@ -44,6 +44,7 @@
#if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF)
+#include <stdio.h>
#include <string.h>
# include <ctype.h>
#include <sys/types.h>
@@ -706,7 +707,7 @@ int mutt_snprintf (va_alist) va_dcl
VA_SHIFT (str, char *);
VA_SHIFT (count, size_t );
VA_SHIFT (fmt, char *);
- (void) mutt_vsnprintf(str, count, fmt, ap);
+ (void) vsnprintf(str, count, fmt, ap);
VA_END;
return(strlen(str));
}
diff --git a/Utilities/cmtar/config.h.in b/Utilities/cmtar/config.h.in
index acbbead..05a7710 100644
--- a/Utilities/cmtar/config.h.in
+++ b/Utilities/cmtar/config.h.in
@@ -51,6 +51,9 @@
/* Define if your system has a working snprintf */
#cmakedefine HAVE_SNPRINTF @HAVE_SNPRINTF@
+/* Define if your system has a working vsnprintf */
+#cmakedefine HAVE_VSNPRINTF @HAVE_VSNPRINTF@
+
/* Define to 1 if you have the <stdint.h> header file. */
#cmakedefine HAVE_STDINT_H @HAVE_STDINT_H@
@@ -184,7 +187,7 @@
#cmakedefine size_t @size_t@
/* Define to `int' if <sys/types.h> does not define. */
-#cmakedefine ssize_t @size_t@
+#cmakedefine ssize_t @ssize_t@
/* Define to `int' if <sys/types.h> doesn't define. */
#cmakedefine uid_t @uid_t@