summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac2
-rw-r--r--include/Exceptions.h4
-rw-r--r--lib/Makefile.sol.mingw2
-rw-r--r--lib/String.cc4
4 files changed, 10 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index ab5cdbe..91e5d7e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -52,7 +52,7 @@ AC_FUNC_REALLOC
AC_TYPE_SIGNAL
AC_FUNC_STRFTIME
AC_FUNC_VPRINTF
-AC_CHECK_FUNCS([__argz_count __argz_next __argz_stringify getcwd gethostbyname memmove mempcpy memset munmap nl_langinfo regcomp setlocale socket stpcpy strcasecmp strchr strcspn strdup strerror strrchr strstr strtoul pipe sleep fcntl])
+AC_CHECK_FUNCS([__argz_count __argz_next __argz_stringify getcwd gethostbyname memmove mempcpy memset munmap nl_langinfo regcomp setlocale socket stpcpy strcasecmp strchr strcspn strdup strerror strrchr strstr strtoul pipe sleep fcntl vsnprintf])
AC_SEARCH_LIBS(socket, socket)
AC_SEARCH_LIBS(gethostbyname, nsl)
diff --git a/include/Exceptions.h b/include/Exceptions.h
index 576f757..c66f7d5 100644
--- a/include/Exceptions.h
+++ b/include/Exceptions.h
@@ -7,6 +7,10 @@
#include <stdlib.h>
#include <generic.h>
+#ifndef pid_t
+typedef int pid_t;
+#endif
+
class String;
class Base {
diff --git a/lib/Makefile.sol.mingw b/lib/Makefile.sol.mingw
index 0550fa8..999c48e 100644
--- a/lib/Makefile.sol.mingw
+++ b/lib/Makefile.sol.mingw
@@ -2,7 +2,7 @@ CC = i586-mingw32msvc-gcc
CXX = i586-mingw32msvc-g++
AR = i586-mingw32msvc-ar
RANLIB = i586-mingw32msvc-ranlib
-CPPFLAGS = -I../include -DFORCE64
+CPPFLAGS = -I../include -DFORCE64 -DHAVE_VSNPRINTF
OBJECTS = Buffer.o Exceptions.o Handle.o Image.o Input.o Main.o Output.o \
String.o checkargs.o datecalc.o fileutils.o generic.o
TARGET = Baltisot-sol.a
diff --git a/lib/String.cc b/lib/String.cc
index 4367ebc..c3e8c07 100644
--- a/lib/String.cc
+++ b/lib/String.cc
@@ -54,7 +54,11 @@ String::String(const char * s, ...) {
#endif
va_start(ap, s);
+#ifdef HAVE_VSNPRINTF
vsnprintf(t, BUFSIZ, s, ap);
+#else
+ vsprintf(t, s, ap);
+#endif
str = Base::strdup(t);
va_end(ap);
siz = ::strlen(str);