]> git.lyx.org Git - lyx.git/blobdiff - src/support/socktools.C
hopefully fix tex2lyx linking.
[lyx.git] / src / support / socktools.C
index 4b4edd60f4ddd50a76ab68619993db5171092411..d22a201c5b63efbae6c01ddf4d199631002e4a23 100644 (file)
 #include <config.h>
 
 #include "support/socktools.h"
+
+#if !defined (HAVE_FCNTL)
+// We provide stubs because we don't (yet?) support the native OS API.
+
+namespace lyx {
+namespace support {
+namespace socktools {
+
+int listen(std::string const &, int)
+{
+       return -1;
+}
+
+
+int accept(int)
+{
+       return -1;
+}
+
+} // namespace socktools
+} // namespace support
+} // namespace lyx
+
+#else // defined (HAVE_FCNTL)
+
 #include "support/lyxlib.h"
 
 #include "debug.h"
@@ -18,7 +43,9 @@
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <fcntl.h>
-#include <unistd.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
 
 #include <cerrno>
 
@@ -135,3 +162,5 @@ int accept(int sd)
 } // namespace socktools
 } // namespace support
 } // namespace lyx
+
+#endif // defined (HAVE_FCNTL)