summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Exceptions.cc12
-rw-r--r--lib/Handle.cc4
-rw-r--r--lib/Makefile.sol.mingw14
3 files changed, 30 insertions, 0 deletions
diff --git a/lib/Exceptions.cc b/lib/Exceptions.cc
index a647f16..110ffaa 100644
--- a/lib/Exceptions.cc
+++ b/lib/Exceptions.cc
@@ -137,6 +137,7 @@ void xfree(char *& p) {
}
}
+#ifdef HAVE_PIPE
int xpipe(int * p, int flag) throw (GeneralException) {
if (pipe(p)) {
throw GeneralException(String(_("Error creating pipe: ")) + strerror(errno));
@@ -144,7 +145,13 @@ int xpipe(int * p, int flag) throw (GeneralException) {
return p[flag];
}
+#else
+int xpipe(int *, int) throw (GeneralException) {
+ throw GeneralException(_("Function pipe() not supported by this system.\n"));
+}
+#endif
+#ifdef HAVE_FORK
pid_t xfork() throw (GeneralException) {
pid_t p;
@@ -156,6 +163,11 @@ pid_t xfork() throw (GeneralException) {
return p;
}
+#else
+pid_t xfork() throw (GeneralException) {
+ throw GeneralException(_("Function fork() not supported by this system.\n"));
+}
+#endif
void xexit(int status) throw (GeneralException) {
throw Exit(status);
diff --git a/lib/Handle.cc b/lib/Handle.cc
index 27426ab..013b749 100644
--- a/lib/Handle.cc
+++ b/lib/Handle.cc
@@ -58,7 +58,9 @@ ssize_t Handle::write(const void *buf, size_t count) throw (GeneralException) {
// cerr << "write: throwing IOAgain for handle " << GetName() << endl;
throw IOAgain();
} else {
+#ifdef HAVE_SLEEP
sleep(1);
+#endif
}
}
} else {
@@ -110,10 +112,12 @@ bool Handle::IsNonBlock(void) const {
}
void Handle::SetNonBlock(void) {
+#ifdef HAVE_FCNTL
if ((h >= 0) || !nonblock) {
fcntl(h, F_SETFL, O_NONBLOCK);
}
nonblock = true;
+#endif
}
Handle & operator<<(Handle & h, const String & s) {
diff --git a/lib/Makefile.sol.mingw b/lib/Makefile.sol.mingw
new file mode 100644
index 0000000..8f15e9e
--- /dev/null
+++ b/lib/Makefile.sol.mingw
@@ -0,0 +1,14 @@
+CC = i586-mingw32msvc-gcc
+CXX = i586-mingw32msvc-g++
+LD = i586-mingw32msvc-ld
+CPPFLAGS = -I../include -DFORCE64
+OBJECTS = Exceptions.o Handle.o Image.o Input.o Main.o Output.o String.o \
+ checkargs.o datecalc.o fileutils.o generic.o
+
+all: Baltisot-sol.dll
+
+Baltisot-sol.dll: $(OBJECTS)
+ $(CXX) -o Baltisot-sol.dll -shared $(OBJECTS) -lz
+
+clean:
+ rm -f *.o