Diffstat (limited to 'libical/src/libical/vsnprintf.c') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libical/src/libical/vsnprintf.c | 28 |
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,7 +1,10 @@ -#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 @@ -22,20 +25,20 @@ * 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> @@ -154,26 +157,15 @@ snprintf(str, n, fmt, va_alist) #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(); } |