]> git.lyx.org Git - lyx.git/commitdiff
Fully enable compilation of LyX 1.4.x on Windows with MinGW/MinSYS.
authorAngus Leeming <leeming@lyx.org>
Mon, 2 May 2005 13:35:30 +0000 (13:35 +0000)
committerAngus Leeming <leeming@lyx.org>
Mon, 2 May 2005 13:35:30 +0000 (13:35 +0000)
Break compilation with MSVC. See accompanying mail on the lyx-devel list.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9895 a592a061-630c-0410-9148-cb99ea01b6c8

25 files changed:
ChangeLog
autogen.sh
config/ChangeLog
config/aspell.m4 [deleted file]
config/pspell.m4 [deleted file]
config/spell.m4 [new file with mode: 0644]
configure.ac
po/ChangeLog
po/POTFILES.in
src/ChangeLog
src/Makefile.am
src/SpellBase.C [new file with mode: 0644]
src/SpellBase.h
src/aspell.C
src/aspell_local.h
src/frontends/controllers/ChangeLog
src/frontends/controllers/ControlSpellchecker.C
src/lyx_cb.C
src/lyxserver.C
src/lyxsocket.C
src/pspell.C
src/pspell.h
src/support/ChangeLog
src/support/os_win32.h [deleted file]
src/support/socktools.C

index 9898af15f791701426bf920e2457f166f040dcec..e918780af9692fbbf3deb0a07eef035b7a9db84f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2005-05-02  Angus Leeming  <leeming@lyx.org>
+
+       * autogen.sh (ACINCLUDE_FILES): remove [ap]spell.m4. Add spell.m4.
+
+       * configure.ac: remove explicit invocation of CHECK_WITH_ASPELL,
+       CHECK_WITH_PSPELL. Add new invocation of LYX_CHECK_SPELL_ENGINES.
+       Also check for select() and socket() system functions and use
+       these to decide whether to build the src/client sun-directory.
+
 2005-03-11  Jean-Marc Lasgouttes  <lasgouttes@lyx.org>
 
        * configure.ac: remove hack when GNU gettext utilities are not
@@ -12,7 +21,7 @@
 2005-03-06  Lars Gullik Bjonnes  <larsbj@gullik.net>
 
        * configure.ac: make the xforms part be built
-       first when building gtk frontend 
+       first when building gtk frontend
 
 2005-03-05  Angus Leeming  <leeming@lyx.org>
 
index ec15c28aedaa7c973bb81d886546e8ae1f2e28f6..36710855fb045cbe59be54a49ff097deecb07c70 100755 (executable)
@@ -4,7 +4,7 @@ ACLOCAL="aclocal -I ${PWD}/m4"
 AUTOHEADER="autoheader"
 AUTOMAKE="automake -a -c --foreign"
 AUTOCONF="autoconf"
-ACINCLUDE_FILES="lyxinclude.m4 libtool.m4 xforms.m4 qt.m4 gtk--.m4 gnome--.m4 gnome.m4 aspell.m4 pspell.m4 cygwin.m4 pkg.m4"
+ACINCLUDE_FILES="lyxinclude.m4 libtool.m4 xforms.m4 qt.m4 gtk--.m4 gnome--.m4 gnome.m4 spell.m4 cygwin.m4 pkg.m4"
 
 # Discover what version of automake we are using.
 automake_version=`$AUTOMAKE --version 2>/dev/null | head -n 1`
index 9456197c067879ca8de4a9f1f1b19cc82571c311..ea32d88b21454fa50edac70b28e64b162bdfcef5 100644 (file)
@@ -1,3 +1,9 @@
+2005-05-02  Angus Leeming  <leeming@lyx.org>
+
+       * aspell.m4, pspell.m4: removed.
+       * spell.m4: new. Incorporates the code in [ap]spell but also adds
+       a test for whether the ISpell-handling code should be compiled.
+
 2005-04-22  Angus Leeming  <leeming@lyx.org>
 
        * qt.m4: Move the Qt-specific preprocessor flags out of the
diff --git a/config/aspell.m4 b/config/aspell.m4
deleted file mode 100644 (file)
index d3b1555..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-# Macro to add for using aspell spellchecker libraries!     -*- sh -*-
-
-# Only checks for "new" aspell, > 0.50
-
-AC_DEFUN([CHECK_WITH_ASPELL],
-[
-    AC_ARG_WITH(aspell,
-       AC_HELP_STRING([--with-aspell],[use ASpell libraries]),
-       [
-           case "$withval" in
-               y*) USING_ASPELL="yes";;
-               *) USING_ASPELL="no";;
-           esac
-           ],
-       [
-           USING_ASPELL="yes"
-           ])
-
-    if test "$USING_ASPELL" = "yes" ; then
-       AC_CHECK_HEADERS(aspell.h aspell/aspell.h, USING_ASPELL="yes", USING_ASPELL="no")
-       AC_CHECK_LIB(aspell, new_aspell_config, LIBS="-laspell $LIBS"; USING_ASPELL="yes", USING_ASPELL="no")
-
-       if test "$USING_ASPELL" = "yes"; then
-           AC_DEFINE(USE_ASPELL, 1, [Define as 1 to use the aspell library])
-           lyx_flags="$lyx_flags use-aspell"
-       fi
-    fi
-    AC_MSG_CHECKING([whether to use aspell])
-    AC_MSG_RESULT($USING_ASPELL)
-    ])
diff --git a/config/pspell.m4 b/config/pspell.m4
deleted file mode 100644 (file)
index 2b803dc..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-# Macro to add for using pspell spellchecker libraries!     -*- sh -*-
-# @author@: Jürgen Vigna
-
-AC_DEFUN([CHECK_WITH_PSPELL],
-[
-    AC_ARG_WITH(pspell,
-       AC_HELP_STRING([--with-pspell],[use PSpell libraries]),
-       [
-           case "$withval" in
-               y*) USING_PSPELL="yes";;
-               *) USING_PSPELL="no";;
-           esac
-           ],
-       [
-           USING_PSPELL="yes"
-           ])
-
-    if test "$USING_PSPELL" = "yes" ; then
-       AC_CHECK_HEADERS(pspell/pspell.h, USING_PSPELL="yes", USING_PSPELL="no")
-       AC_CHECK_LIB(pspell, main, LIBS="-lpspell $LIBS"; USING_PSPELL="yes", USING_PSPELL="no")
-
-       if test "$USING_PSPELL" = "yes"; then
-           AC_DEFINE(USE_PSPELL, 1, [Define as 1 to use the pspell library])
-           lyx_flags="$lyx_flags use-pspell"
-       fi
-    fi
-    AC_MSG_CHECKING([whether to use pspell])
-    AC_MSG_RESULT($USING_PSPELL)
-    ])
diff --git a/config/spell.m4 b/config/spell.m4
new file mode 100644 (file)
index 0000000..6f8fe40
--- /dev/null
@@ -0,0 +1,82 @@
+# Macro to add for using aspell spellchecker libraries!     -*- sh -*-
+# Only checks for "new" aspell, > 0.50
+AC_DEFUN([CHECK_WITH_ASPELL],
+[
+    lyx_use_aspell=true
+    AC_ARG_WITH(aspell,        AC_HELP_STRING([--with-aspell],[use ASpell libraries]))
+    test "$with_aspell" = "no" && lyx_use_aspell=false
+
+    if $lyx_use_aspell ; then
+       AC_CHECK_HEADERS(aspell.h aspell/aspell.h, 
+           [lyx_use_aspell=true; break;], 
+           [lyx_use_aspell=false])
+       AC_CHECK_LIB(aspell, new_aspell_config, LIBS="-laspell $LIBS", lyx_use_aspell=false)
+
+       AC_MSG_CHECKING([whether to use aspell])
+       if $lyx_use_aspell ; then
+           AC_MSG_RESULT(yes)
+           AC_DEFINE(USE_ASPELL, 1, [Define as 1 to use the aspell library])
+           lyx_flags="$lyx_flags use-aspell"
+       else
+           AC_MSG_RESULT(no)
+       fi
+    fi
+    ])
+
+
+# Macro to add for using pspell spellchecker libraries!     -*- sh -*-
+# @author@: Jürgen Vigna
+AC_DEFUN([CHECK_WITH_PSPELL],
+[
+    lyx_use_pspell=true
+    AC_ARG_WITH(pspell,        AC_HELP_STRING([--with-pspell],[use PSpell libraries]))
+    test "$with_pspell" = "no" && lyx_use_pspell=false
+
+    if $lyx_use_pspell ; then
+       AC_CHECK_HEADERS(pspell/pspell.h,, lyx_use_pspell=false)
+       AC_CHECK_LIB(pspell, main, LIBS="-lpspell $LIBS", lyx_use_pspell=false)
+
+       AC_MSG_CHECKING([whether to use pspell])
+       if $lyx_use_pspell ; then
+           AC_MSG_RESULT(yes)
+           AC_DEFINE(USE_PSPELL, 1, [Define as 1 to use the pspell library])
+           lyx_flags="$lyx_flags use-pspell"
+       else
+           AC_MSG_RESULT(no)
+       fi
+    fi
+    ])
+
+### Check if we want spell libraries, prefer new aspell
+AC_DEFUN([LYX_CHECK_SPELL_ENGINES],
+[
+    lyx_use_aspell=false
+    lyx_use_pspell=false
+    lyx_use_ispell=false
+
+    dnl Prefer use of the aspell library over pspell.
+    CHECK_WITH_ASPELL
+    if $lyx_use_aspell ; then : ; else
+        CHECK_WITH_PSPELL
+    fi
+
+    dnl check for the ability to communicate through unix pipes
+    dnl with an external ispell process.
+    dnl Do this independent of the existence of the aspell, pspell libraries.
+    lyx_use_ispell=true
+    AC_LANG_PUSH(C)
+    AC_CHECK_FUNCS(select dup2,, [lyx_use_ispell=false])
+    AC_LANG_POP(C)
+    AC_MSG_CHECKING([whether to use ispell])
+    if $lyx_use_ispell ; then
+      AC_MSG_RESULT(yes)
+      AC_DEFINE(USE_ISPELL, 1, [Define as 1 to use an external ispell process for spell-checking])
+      lyx_flags="$lyx_flags use-ispell"
+    else
+      AC_MSG_RESULT(no)
+    fi
+
+    AM_CONDITIONAL(USE_ASPELL, $lyx_use_aspell)
+    AM_CONDITIONAL(USE_PSPELL, $lyx_use_pspell)
+    AM_CONDITIONAL(USE_ISPELL, $lyx_use_ispell)
+    ])
index 0983d990c2c7dcdfcdb7ad6fc4374621830c412f..a6dbb02b598d2a4bcdf36f1d14a16be11261f1df 100644 (file)
@@ -132,12 +132,6 @@ AC_LIBTOOL_WIN32_DLL
 #AM_PROG_LIBTOOL
 LYX_PROG_LIBTOOL
 
-### Check if we want spell libraries, prefer new aspell
-CHECK_WITH_ASPELL
-if test "$USING_ASPELL" != "yes"; then
-       CHECK_WITH_PSPELL
-fi
-
 ### Check for some Cygwin-specific details.
 CHECK_WITH_CYGWIN
 
@@ -291,6 +285,15 @@ AC_LANG_PUSH(C)
 AC_CHECK_FUNCS(mkfifo mkstemp mktemp lstat readlink)
 AC_LANG_POP(C)
 
+LYX_CHECK_SPELL_ENGINES
+
+lyx_client_subdir=true
+AC_LANG_PUSH(C)
+AC_CHECK_FUNCS(select socket,, [lyx_client_subdir=false])
+AM_CONDITIONAL(BUILD_CLIENT_SUBDIR, $lyx_client_subdir)
+AC_LANG_POP(C)
+
+
 AC_FUNC_SELECT_ARGTYPES
 
 ### Some information on what just happened
index bf7d7df78152226fa5e1758608b169528f6f23e2..58a8e1aaea55b421949e1b47b1b0398f81c00a87 100644 (file)
@@ -1,3 +1,7 @@
+2005-05-02  Angus Leeming  <leeming@lyx.org>
+
+       * po/POTFILES.in: src/SpellBase.C now contains a translatable string.
+
 2005-04-28  Michael Schmitt  <michael.schmitt@teststep.org>
 
        * Makefile.in.in: remove duplicate lines
index 6131603f5ae71a038ebc80b6431c92cac243aa33..162e37752bcc4b351c15ad80701bfcefa1f3a602 100644 (file)
@@ -6,6 +6,7 @@ src/CutAndPaste.C
 src/LColor.C
 src/LaTeX.C
 src/MenuBackend.C
+src/SpellBase.C
 src/buffer.C
 src/buffer_funcs.C
 src/bufferlist.C
index 8a37fe4e32d515088b5e12607182b48bd37fe23c..5ccfa38a1af489998e95f016e666fad54ce44338 100644 (file)
@@ -1,12 +1,29 @@
+2005-05-02  Angus Leeming  <leeming@lyx.org>
+
+       * lyx_cb.C: artificially define fork() on Windows as a no-op failing
+       function so that suto-saving works, albeit in a blocking manner.
+
+       * Makefile.am: make compilation of the client sub directory, of
+       apsellC, aspell_local.h, pspell.[Ch] and ispell.[Ch] dependent
+       on conditionals set at configure time.
+
+       * SpellBase.[Ch]: no longer an abstract base class. Instead,
+       it can be compiled in its own right but has no-op functionality.
+
+       * aspell.C, pspell.C: remove preprocessor guards. The files should
+       be compiled only if the necessary functionality exists.
+
+       * lyxserver.C, lyxsocket.C: disable on Windows.
+
 2005-05-01  Martin Vermeer  <martin.vermeer@hut.fi>
 
-       * text.C (leftMargin): Fix the parindent use bug (1764) 
+       * text.C (leftMargin): Fix the parindent use bug (1764)
        by dirty trick
 
 2005-04-28  Michael Schmitt  <michael.schmitt@teststep.org>
 
        * lyxlayout.C (Read): transform underscores to spaces in CopyStyle
-       argument. 
+       argument.
 
 2005-04-25  Angus Leeming  <leeming@lyx.org>
 
index 5562fb4753db1b688c14a9c4d9d88ee48bf70aa4..6b556d44d14584a76323fbc43671321c174f1f10 100644 (file)
@@ -4,7 +4,11 @@ DISTCLEANFILES += config.h libintl.h version.C stamp-version version.C-tmp
 
 MAINTAINERCLEANFILES += $(srcdir)/config.h.in
 
-SUBDIRS = mathed insets graphics support frontends . client tex2lyx
+if BUILD_CLIENT_SUBDIR
+CLIENT = client
+endif
+
+SUBDIRS = mathed insets graphics support frontends . $(CLIENT) tex2lyx
 
 EXTRA_DIST = config.h.in stamp-h.in version.C.in \
        Sectioning.h \
@@ -51,6 +55,18 @@ BUILT_SOURCES = version.C
 
 AM_CPPFLAGS = $(PCH_FLAGS) $(BOOST_INCLUDES)
 
+if USE_ASPELL
+ASPELL = aspell.C aspell_local.h
+endif
+if USE_PSPELL
+PSPELL = pspell.C pspell.h
+endif
+if USE_ISPELL
+ISPELL = ispell.C ispell.h
+endif
+
+
+
 lyx_SOURCES = \
        Bidi.C \
        Bidi.h \
@@ -101,8 +117,6 @@ lyx_SOURCES = \
        ToolbarBackend.C \
        ToolbarBackend.h \
        WordLangTuple.h \
-       aspell.C \
-       aspell_local.h \
        author.C \
        author.h \
        boost.C \
@@ -241,11 +255,8 @@ lyx_SOURCES = \
        paragraph_pimpl.h \
        pariterator.C \
        pariterator.h \
+       $(ASPELL) $(PSPELL) $(ISPELL) SpellBase.C \
        SpellBase.h \
-       ispell.C \
-       ispell.h \
-       pspell.C \
-       pspell.h \
        rowpainter.C \
        rowpainter.h \
        sgml.C \
diff --git a/src/SpellBase.C b/src/SpellBase.C
new file mode 100644 (file)
index 0000000..7b5b04e
--- /dev/null
@@ -0,0 +1,49 @@
+/**
+ * \file SpellBase.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author unknown
+ * \author John Levon
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#include <config.h>
+
+#include "SpellBase.h"
+#include "gettext.h"
+
+using std::string;
+
+
+bool SpellBase::alive()
+{
+       return false;
+}
+
+
+SpellBase::Result SpellBase::check(WordLangTuple const &)
+{
+       return UNKNOWN_WORD;
+}
+
+
+void SpellBase::insert(WordLangTuple const &)
+{}
+
+
+void SpellBase::accept(WordLangTuple const &)
+{}
+
+
+string const SpellBase::nextMiss()
+{
+       return string();
+}
+
+
+string const SpellBase::error()
+{
+       return _("Native OS API not yet supported.");
+}
index 7850cd1517599ddbcf5934cf2d1249c180ce21ed..99bfd4cc5660597ea0423014ac826b3091a32252 100644 (file)
@@ -20,6 +20,7 @@ class WordLangTuple;
 
 /**
  * Base class of all spell checker implementations.
+ * The class can be instantiated but will have no functionality.
  */
 class SpellBase {
 public:
@@ -43,23 +44,22 @@ public:
        virtual ~SpellBase() {}
 
        /// return true if the spellchecker instance still exists
-       virtual bool alive() = 0;
+       virtual bool alive();
 
        /// check the given word of the given lang code and return the result
-       virtual enum Result check(WordLangTuple const &) = 0;
+       virtual enum Result check(WordLangTuple const &);
 
        /// insert the given word into the personal dictionary
-       virtual void insert(WordLangTuple const &) = 0;
+       virtual void insert(WordLangTuple const &);
 
        /// accept the given word temporarily
-       virtual void accept(WordLangTuple const &) = 0;
+       virtual void accept(WordLangTuple const &);
 
        /// return the next near miss after a SUGGESTED_WORDS result
-       virtual std::string const nextMiss() = 0;
+       virtual std::string const nextMiss();
 
        /// give an error message on messy exit
-       virtual std::string const error() = 0;
-
+       virtual std::string const error();
 };
 
 #endif // SPELL_BASE_H
index 84fb21036994a8b56b3f955f0f790abbcd2ec97d..be2dc6ae981734d7c9b29c37948c21142ffca9fc 100644 (file)
@@ -11,8 +11,6 @@
 
 #include <config.h>
 
-#ifdef USE_ASPELL
-
 #include "debug.h"
 
 #include <aspell.h>
@@ -144,5 +142,3 @@ string const ASpell::error()
 
        return (err ? err : "");
 }
-
-#endif // USE_ASPELL
index 59d67294c45c2245aced95278f75750b276bda91..7bfcd01238ff00b5072886380a08c8175ca103a1 100644 (file)
@@ -75,4 +75,4 @@ private:
        AspellCanHaveError * spell_error_object;
 };
 
-#endif // ASPELL_H
+#endif // LYX_ASPELL_H
index a60489bd00a91426b25446f1a82b5eafefb9caf8..b2e212990cb092912a9c718444148f4cbdb5a431 100644 (file)
@@ -1,3 +1,8 @@
+2005-05-02  Angus Leeming  <leeming@lyx.org>
+
+       * ControlSpellchecker.C: clean-up the creation of the wrappers to
+       the different possible spelling engines.
+
 2005-04-29  Martin Vermeer  <martin.vermeer@hut.fi>
 
        * ControlCharacter.h (getLFun):Trivial bug fix
index 7e8c7b60f3026c95219b719db411f73c7c2c9a69..369ecb7520c6d2983d531af35957fa0d28207a35 100644 (file)
 #include "lyxrc.h"
 #include "paragraph.h"
 
-#include "ispell.h"
-#ifdef USE_PSPELL
-# include "pspell.h"
-#else
-#ifdef USE_ASPELL
+#if defined(USE_ASPELL)
 # include "aspell_local.h"
+#elif defined(USE_PSPELL)
+# include "pspell.h"
 #endif
+
+#if defined(USE_ISPELL)
+# include "ispell.h"
+#else
+# include "SpellBase.h"
 #endif
 
 #include "support/textutils.h"
@@ -68,19 +71,22 @@ SpellBase * getSpeller(BufferParams const & bp)
                      ? lyxrc.isp_alt_lang
                      : bp.language->code();
 
-#ifdef USE_ASPELL
+#if defined(USE_ASPELL)
        if (lyxrc.use_spell_lib)
                return new ASpell(bp, lang);
-#endif
-#ifdef USE_PSPELL
+#elif defined(USE_PSPELL)
        if (lyxrc.use_spell_lib)
                return new PSpell(bp, lang);
 #endif
 
+#if defined(USE_ISPELL)
        lang = (lyxrc.isp_use_alt_lang) ?
                lyxrc.isp_alt_lang : bp.language->lang();
 
        return new ISpell(bp, lang);
+#else
+       return new SpellBase;
+#endif
 }
 
 } // namespace anon
@@ -91,6 +97,8 @@ bool ControlSpellchecker::initialiseParams(std::string const &)
        lyxerr[Debug::GUI] << "Spellchecker::initialiseParams" << endl;
 
        speller_.reset(getSpeller(kernel().buffer().params()));
+       if (!speller_.get())
+               return false;
 
        // reset values to initial
        oldval_ = 0;
index add78e0693ef0b431e0b156781d89e56964a1fd9..2112cda2468db70679293758910c5a7f559fe0d9 100644 (file)
 #include "support/path.h"
 #include "support/systemcall.h"
 
+#ifdef _WIN32
+# define fork() -1
+#endif
+
 #include <boost/shared_ptr.hpp>
 #include <boost/filesystem/operations.hpp>
 
index 70696796e4f7cfd2c523298f82bd452a2f5b0652..ad743460a1ac0072500370ec80d551c8b35e2dd8 100644 (file)
@@ -75,13 +75,39 @@ using std::endl;
 using std::string;
 
 
-// provide an empty mkfifo() if we do not have one. This disables the
-// lyxserver.
-#ifndef HAVE_MKFIFO
-int mkfifo(char const * __path, mode_t __mode) {
-       return 0;
+#if !defined (HAVE_MKFIFO)
+// We provide a stub class that disables the lyxserver.
+
+void LyXComm::openConnection()
+{}
+
+
+void LyXComm::closeConnection()
+{}
+
+
+int LyXComm::startPipe(string const & filename, bool write)
+{
+       return -1;
 }
-#endif
+
+
+void LyXComm::endPipe(int & fd, string const & filename, bool write)
+{}
+
+
+void LyXComm::emergencyCleanup()
+{}
+
+void LyXComm::read_ready()
+{}
+
+
+void LyXComm::send(string const & msg)
+{}
+
+
+#else // defined (HAVE_MKFIFO)
 
 
 void LyXComm::openConnection()
@@ -355,6 +381,8 @@ void LyXComm::send(string const & msg)
 #endif
 }
 
+#endif // defined (HAVE_MKFIFO)
+
 
 string const LyXComm::inPipeName() const
 {
index 9bd4c5f9fd4a475d31391914f04d6a4e8971819d..73f8b210694e6467c7a7075bc31c6750bf1f6c7c 100644 (file)
 
 #include <config.h>
 
+#include <config.h>
+
 #include "lyxsocket.h"
 
+
+#if !(defined(HAVE_READ) && defined(HAVE_WRITE) && defined(HAVE_CLOSE))
+// We provide stub classes to disables the sockets.
+
+LyXServerSocket::LyXServerSocket(LyXFunc *, std::string const &)
+{}
+
+
+LyXServerSocket::~LyXServerSocket()
+{}
+
+
+std::string const & LyXServerSocket::address() const
+{
+       return address_;
+}
+
+
+void LyXServerSocket::serverCallback()
+{}
+
+
+void LyXServerSocket::dataCallback(int)
+{}
+
+
+void LyXServerSocket::writeln(std::string const &)
+{}
+
+
+LyXDataSocket::LyXDataSocket(int)
+{}
+
+
+LyXDataSocket::~LyXDataSocket()
+{}
+
+
+bool LyXDataSocket::connected() const
+{
+       return false;
+}
+
+
+bool LyXDataSocket::readln(std::string &)
+{
+       return false;
+}
+
+
+void LyXDataSocket::writeln(std::string const &)
+{}
+
+#else // defined(HAVE_READ) && defined(HAVE_WRITE) && defined(HAVE_CLOSE)
+
+
 #include "debug.h"
 #include "funcrequest.h"
 #include "LyXAction.h"
@@ -270,3 +328,5 @@ void LyXDataSocket::writeln(string const & line)
                connected_ = false;
        }
 }
+
+#endif // defined(HAVE_READ) && defined(HAVE_WRITE) && defined(HAVE_CLOSE)
index 9ca0feaeeec9882301fdbf6d0324c938943158b4..f7122650ba6eafa317d065efd8cf8bda9c8f961b 100644 (file)
@@ -11,8 +11,6 @@
 
 #include <config.h>
 
-#ifdef USE_PSPELL
-
 #include "debug.h"
 
 #define USE_ORIGINAL_MANAGER_FUNCS 1
@@ -155,5 +153,3 @@ string const PSpell::error()
                return err;
        return "";
 }
-
-#endif // USE_PSPELL
index 3323e8a769c674ed576157289b48baf6eee2408d..d645aacad3b98c33b7bbc49fae748b92758f1da9 100644 (file)
@@ -75,4 +75,4 @@ private:
        PspellCanHaveError * spell_error_object;
 };
 
-#endif // PSPELL_H
+#endif // LYX_PSPELL_H
index d6bea614ae40562fbe237074d0a4d118553f2ceb..0fbd71a33fe277536be00f61d09746beda0d97f4 100644 (file)
@@ -1,3 +1,9 @@
+2005-05-02  Angus Leeming  <leeming@lyx.org>
+
+       * socktool.C (listen, accept): provide stub versions for Windows.
+
+       * os_win32.h: removed.
+
 2005-04-29  Angus Leeming  <leeming@lyx.org>
 
        * os_win32.C (init): Merge changes from Asger's win32_kludge.diff
diff --git a/src/support/os_win32.h b/src/support/os_win32.h
deleted file mode 100644 (file)
index a8c9791..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-// os_win32.h copyright "Ruurd A. Reitsma" <R.A.Reitsma@wbmt.tudelft.nl>
-
-#ifndef _OS_WIN32_H_
-#define _OS_WIN32_H_
-
-//Avoid zillions of windows includes
-#ifndef WIN32_LEAN_AND_MEAN
-#define WIN32_LEAN_AND_MEAN
-#endif
-
-#include <windows.h>
-
-// Avoid some very annoying macros from MFC
-#  undef max
-#  undef min
-
-#if defined( __SGI_STL_PORT )
-
-  namespace std {
-    // These overloads prevent ambiguity errors when signed and unsigned integers are compared.
-    inline long min(long x, long y) {return std::min(x, y);}
-    inline long max(long x, long y) {return std::max(x, y);}
-  }
-
-#else // defined( __SGI_STL_PORT )
-  namespace std {
-    // These overloads prevent ambiguity errors when int, long and unsigned int and int are compared.
-
-       inline int min(int x, int y) { return x < y ? x : y; }
-       inline int max(int x, int y) { return x > y ? x : y; }
-
-       inline unsigned int min(unsigned int x, unsigned int y) { return x < y ? x : y; }
-       inline unsigned int max(unsigned int x, unsigned int y) { return x > y ? x : y; }
-
-       inline long min(long x, long y) { return x < y ? x : y; }
-       inline long max(long x, long y) { return x > y ? x : y; }
-
-       inline long min(int x, long y) { return x < y ? x : y; }
-       inline long max(int x, long y) { return x > y ? x : y; }
-
-       inline long min(long x, int y) { return x < y ? x : y; }
-       inline long max(long x, int y) { return x > y ? x : y; }
-
-       inline unsigned long min(unsigned long x, unsigned long y) { return x < y ? x : y; }
-       inline unsigned long max(unsigned long x, unsigned long y) { return x > y ? x : y; }
-
-       inline double min(double x, double y) { return x < y ? x : y; }
-       inline double max(double x, double y) { return x > y ? x : y; }
-  }
-
-#endif // defined( __SGI_STL_PORT )
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-//fcntl.h
-#define FD_CLOEXEC     1       /* posix */
-#define        F_DUPFD         0       /* Duplicate fildes */
-#define        F_GETFD         1       /* Get fildes flags (close on exec) */
-#define        F_SETFD         2       /* Set fildes flags (close on exec) */
-#define        F_GETFL         3       /* Get file flags */
-#define        F_SETFL         4       /* Set file flags */
-#define O_NONBLOCK      0x4000
-inline int fcntl (int, int, ...) {return -1;}
-
-//unistd.h
-inline int fork () {return -1;}
-#define pipe(a) _pipe(a,0,0)
-
-
-//sys/wait.h
-#define waitpid(a,b,c) cwait(b,a,c)
-#define WNOHANG 1
-#define WUNTRACED 2
-#define WIFEXITED(a) 0
-#define WEXITSTATUS(a) 0
-#define WIFSIGNALED(a) 0
-#define WTERMSIG(a) 0
-#define WIFSTOPPED(a) 0
-#define WSTOPSIG(a) 0
-
-//sys/types.h
-#define fd_set int
-
-//sys/select.h
-//#define select(a,b,c,d,e) -1
-#define FD_ZERO(a)
-#define FD_SET(a,b)
-#define FD_ISSET(fd, set) 0
-
-#ifndef __MINGW32__ //already defined in mingw headers
-
-#define        _S_IFBLK        0x3000
-#define        S_IFIFO         _S_IFIFO
-#define        S_IFBLK         _S_IFBLK
-#define        S_ISFIFO(m)     (((m) & S_IFMT) == S_IFIFO)
-#define        S_ISBLK(m)      (((m) & S_IFMT) == S_IFBLK)
-#define popen(a,b) _popen(a,b)
-#define pclose(a) _pclose(a)
-
-#endif //!__MINGW32
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif //_OS_WIN32_H_
index 23a0b5d011143968ec9a9f6c58e2fdff3e1cdd74..eb6e17f4e837e548fe08b135aee1bbc351de1f27 100644 (file)
 #include <config.h>
 
 #include "support/socktools.h"
+
+#if !defined (HAVE_SOCKET)
+// 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_SOCKET)
+
 #include "support/lyxlib.h"
 
 #include "debug.h"
@@ -137,3 +162,5 @@ int accept(int sd)
 } // namespace socktools
 } // namespace support
 } // namespace lyx
+
+#endif // defined (HAVE_SOCKET)