summaryrefslogtreecommitdiffabout
path: root/libical/src/libical/vsnprintf.c
Side-by-side diff
Diffstat (limited to 'libical/src/libical/vsnprintf.c') (more/less context) (show whitespace changes)
-rw-r--r--libical/src/libical/vsnprintf.c28
1 files changed, 10 insertions, 18 deletions
diff --git a/libical/src/libical/vsnprintf.c b/libical/src/libical/vsnprintf.c
index 88a8c63..982920b 100644
--- a/libical/src/libical/vsnprintf.c
+++ b/libical/src/libical/vsnprintf.c
@@ -1,9 +1,12 @@
-#ifdef __osf__
+#ifndef WIN32
+#include "config.h"
+#endif
+#ifndef HAVE_SNPRINTF
/*
* Revision 12: http://theos.com/~deraadt/snprintf.c
*
* Copyright (c) 1997 Theo de Raadt
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -20,24 +23,24 @@
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/types.h>
-#include <stdio.h>
-
-#include <unistd.h>
+#ifndef WIN32
#include <sys/param.h>
#include <sys/mman.h>
+#include <unistd.h>
+#endif
+#include <sys/types.h>
#include <signal.h>
-
+#include <stdio.h>
#include <string.h>
#if __STDC__
#include <stdarg.h>
#include <stdlib.h>
#else
#include <varargs.h>
#endif
#include <setjmp.h>
@@ -152,29 +155,18 @@ snprintf(str, n, fmt, va_alist)
#else
va_start(ap);
#endif
return (vsnprintf(str, n, fmt, ap));
va_end(ap);
}
-#elif defined ( _WIN32 )
-
-#include <stdio.h>
-#include <stdarg.h>
-
-int snprintf(char *str, size_t n, char const *fmt, ...)
-{
- va_list ap;
- va_start(ap, fmt);
-
- return _snprintf(str, n, fmt, ap);
-}
#else
+
/* ANSI C forbids an empty source file... */
static void vsnprintf_dummy_func() {
vsnprintf_dummy_func();
}
#endif