Rob, Asger
the changes I've just committed will probably break your build. To help you
resurrect things, I attach the current config.h.in from which config.h is
generated. I also attach the changes from the previous config.h.in. The
new macros HAVE_DUP2, HAVE_SELECT, HAVE_SOCKET and USE_ISPELL should all
remain undefined for you. Nonetheless, it might be worth while looking
through config.h.in to see if anything new has been added since your copy
of config.h was added to the development/Win32 directory.
You should also:
* remove the src/client sub directory from your project. The code depends
entirely on the unix API for its functionality. There is no hope of
getting it to work in its present form on Windows.
* remove src/ispell.[Ch] from your project. The code depends on a unix
implementation of anonymous pipes. We'll get this working in the 1.5
series.
* remove src/aspell.[Ch] from your project unless you have USE_ASPELL
defined in config.h.
* remove src/pspell.[Ch] from your project unless you have USE_PSPELL
definged in config.h. You should prefer aspell over pspell if you attempt
to get spell checking working.
Finally, I have removed src/support/os_win32.h from the cvs tree because I
no longer need it to compile with the mingw compiler. I attach the file
for reference. We should work to enable compilation of the sources with
the MSVC compiler without this kludge.
Looking at development/Win32/win32_kludge.diff, I'd expect that you'll need
to hack these files to get an otherwise pristine LyX source tree to
compile with MSVC.
src/DepTable.C
src/buffer.C
src/cursor.C
src/frontends/LyXView.C
src/frontends/qt2/QLyXKeySym.C
src/support/filetools.C
src/support/tempname.C
You may also have problems with std::min, std::max, which are implemented
as macros in your standard library. You should probably remove any
using std::min;
using std::max;
declarations and change things like src/text3.C:
- int const y = std::max(0, std::min(wh - 1, cmd.y));
+ int const y = (std::max)(0, (std::min)(wh - 1, cmd.y));
to get things to compile.
If you could prepare an updated version of win32_kludge.diff, it would make
it easier to see exactly what still needs to be done.
--
Angus
/* src/config.h.in. Generated from configure.ac by autoheader. */
/* -*- C++ -*- */
/*
* \file config.h
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* This is the compilation configuration file for LyX.
* It was generated by autoconfs configure.
* You might want to change some of the defaults if something goes wrong
* during the compilation.
*/
#ifndef _CONFIG_H
#define _CONFIG_H
/* Location of Aiksaurus.h */
#undef AIKSAURUS_H_LOCATION
/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
systems. This function is required for `alloca.c' support on those systems.
*/
#undef CRAY_STACKSEG_END
/* Define if your C++ compiler puts C library functions in the global
namespace */
#undef CXX_GLOBAL_CSTD
/* Define to 1 if using `alloca.c'. */
#undef C_ALLOCA
/* Define if you are building a development version of LyX */
#undef DEVEL_VERSION
/* Define if you want assertions to be enabled in the code */
#undef ENABLE_ASSERTIONS
/* Define to 1 if translation of program messages to the user's native
language is requested. */
#undef ENABLE_NLS
/* Define to 1 if you have `alloca', as a function or macro. */
#undef HAVE_ALLOCA
/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
*/
#undef HAVE_ALLOCA_H
/* Define to 1 if you have the <argz.h> header file. */
#undef HAVE_ARGZ_H
/* Define to 1 if you have the <aspell/aspell.h> header file. */
#undef HAVE_ASPELL_ASPELL_H
/* Define to 1 if you have the <aspell.h> header file. */
#undef HAVE_ASPELL_H
/* Define to 1 if you have the `asprintf' function. */
#undef HAVE_ASPRINTF
/* Define if the GNU dcgettext() function is already present or preinstalled.
*/
#undef HAVE_DCGETTEXT
/* Define to 1 if you have the declaration of `feof_unlocked', and to 0 if you
don't. */
#undef HAVE_DECL_FEOF_UNLOCKED
/* Define to 1 if you have the declaration of `fgets_unlocked', and to 0 if
you don't. */
#undef HAVE_DECL_FGETS_UNLOCKED
/* Define to 1 if you have the declaration of `getc_unlocked', and to 0 if you
don't. */
#undef HAVE_DECL_GETC_UNLOCKED
/* Define if you have the prototype for function `istreambuf_iterator' */
#undef HAVE_DECL_ISTREAMBUF_ITERATOR
/* Define if you have the prototype for function `mkstemp' */
#undef HAVE_DECL_MKSTEMP
/* Define to 1 if you have the declaration of `_snprintf', and to 0 if you
don't. */
#undef HAVE_DECL__SNPRINTF
/* Define to 1 if you have the declaration of `_snwprintf', and to 0 if you
don't. */
#undef HAVE_DECL__SNWPRINTF
/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
*/
#undef HAVE_DIRENT_H
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the `dup2' function. */
#undef HAVE_DUP2
/* Define to 1 if you have the <flimage.h> header file. */
#undef HAVE_FLIMAGE_H
/* Define to 1 if you have the `fwprintf' function. */
#undef HAVE_FWPRINTF
/* Define to 1 if you have the `getcwd' function. */
#undef HAVE_GETCWD
/* Define to 1 if you have the `getegid' function. */
#undef HAVE_GETEGID
/* Define to 1 if you have the `geteuid' function. */
#undef HAVE_GETEUID
/* Define to 1 if you have the `getgid' function. */
#undef HAVE_GETGID
/* Define to 1 if you have the `getpagesize' function. */
#undef HAVE_GETPAGESIZE
/* Define if the GNU gettext() function is already present or preinstalled. */
#undef HAVE_GETTEXT
/* Define to 1 if you have the `getuid' function. */
#undef HAVE_GETUID
/* Define if you have the iconv() function. */
#undef HAVE_ICONV
/* Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>. */
#undef HAVE_INTMAX_T
/* Define if <inttypes.h> exists and doesn't clash with <sys/types.h>. */
#undef HAVE_INTTYPES_H
/* Define if <inttypes.h> exists, doesn't clash with <sys/types.h>, and
declares uintmax_t. */
#undef HAVE_INTTYPES_H_WITH_UINTMAX
/* Define to 1 if you have the <ios> header file. */
#undef HAVE_IOS
/* Define to 1 if you have the <istream> header file. */
#undef HAVE_ISTREAM
/* Define this if you have the kpsewhich program working on your system. */
#undef HAVE_KPSEWHICH
/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
#undef HAVE_LANGINFO_CODESET
/* Define if your <locale.h> file defines LC_MESSAGES. */
#undef HAVE_LC_MESSAGES
/* Define this if you have the AikSaurus library */
#undef HAVE_LIBAIKSAURUS
/* Define to 1 if you have the `c' library (-lc). */
#undef HAVE_LIBC
/* Define to 1 if you have the `m' library (-lm). */
#undef HAVE_LIBM
/* Define to 1 if you have the <limits> header file. */
#undef HAVE_LIMITS
/* Define to 1 if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
/* Define to 1 if you have the <locale> header file. */
#undef HAVE_LOCALE
/* Define to 1 if you have the <locale.h> header file. */
#undef HAVE_LOCALE_H
/* Define if you have the 'long double' type. */
#undef HAVE_LONG_DOUBLE
/* Define if you have the 'long long' type. */
#undef HAVE_LONG_LONG
/* Define to 1 if you have the `lstat' function. */
#undef HAVE_LSTAT
/* Define to 1 if you have the <malloc.h> header file. */
#undef HAVE_MALLOC_H
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the `mempcpy' function. */
#undef HAVE_MEMPCPY
/* Define to 1 if you have the `mkdir' function. */
#undef HAVE_MKDIR
/* Define to 1 if you have the `mkfifo' function. */
#undef HAVE_MKFIFO
/* Define to 1 if you have the `mkstemp' function. */
#undef HAVE_MKSTEMP
/* Define to 1 if you have the `mktemp' function. */
#undef HAVE_MKTEMP
/* Define to 1 if you have a working `mmap' system call. */
#undef HAVE_MMAP
/* Define to 1 if you have the `munmap' function. */
#undef HAVE_MUNMAP
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
#undef HAVE_NDIR_H
/* Define to 1 if you have the <nl_types.h> header file. */
#undef HAVE_NL_TYPES_H
/* Define to 1 if you have the <ostream> header file. */
#undef HAVE_OSTREAM
/* Define if your printf() function supports format strings with positions. */
#undef HAVE_POSIX_PRINTF
/* Define to 1 if you have the <pspell/pspell.h> header file. */
#undef HAVE_PSPELL_PSPELL_H
/* Define to 1 if you have the `putenv' function. */
#undef HAVE_PUTENV
/* Define to 1 if you have the `readlink' function. */
#undef HAVE_READLINK
/* Define to 1 if you have the `select' function. */
#undef HAVE_SELECT
/* Define to 1 if you have the `setenv' function. */
#undef HAVE_SETENV
/* Define to 1 if you have the `setlocale' function. */
#undef HAVE_SETLOCALE
/* Define to 1 if you have the `snprintf' function. */
#undef HAVE_SNPRINTF
/* Define to 1 if you have the `socket' function. */
#undef HAVE_SOCKET
/* Define to 1 if you have the <sstream> header file. */
#undef HAVE_SSTREAM
/* Define to 1 if you have the <stddef.h> header file. */
#undef HAVE_STDDEF_H
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define if <stdint.h> exists, doesn't clash with <sys/types.h>, and declares
uintmax_t. */
#undef HAVE_STDINT_H_WITH_UINTMAX
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define if you have a conforming std::count template, otherwise HP version
of count template is assumed. */
#undef HAVE_STD_COUNT
/* Define to 1 if you have the `stpcpy' function. */
#undef HAVE_STPCPY
/* Define to 1 if you have the `strcasecmp' function. */
#undef HAVE_STRCASECMP
/* Define to 1 if you have the `strdup' function. */
#undef HAVE_STRDUP
/* Define to 1 if you have the `strerror' function. */
#undef HAVE_STRERROR
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the `strtoul' function. */
#undef HAVE_STRTOUL
/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
*/
#undef HAVE_SYS_DIR_H
/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
*/
#undef HAVE_SYS_NDIR_H
/* Define to 1 if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H
/* Define to 1 if you have the <sys/select.h> header file. */
#undef HAVE_SYS_SELECT_H
/* Define to 1 if you have the <sys/socket.h> header file. */
#undef HAVE_SYS_SOCKET_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the `tsearch' function. */
#undef HAVE_TSEARCH
/* Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>. */
#undef HAVE_UINTMAX_T
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define if you have the 'unsigned long long' type. */
#undef HAVE_UNSIGNED_LONG_LONG
/* Define if you have the 'wchar_t' type. */
#undef HAVE_WCHAR_T
/* Define to 1 if you have the `wcslen' function. */
#undef HAVE_WCSLEN
/* Define if you have the 'wint_t' type. */
#undef HAVE_WINT_T
/* Define to 1 if you have the <X11/flimage.h> header file. */
#undef HAVE_X11_FLIMAGE_H
/* Define to 1 if you have the <zlib.h> header file. */
#undef HAVE_ZLIB_H
/* Define to 1 if you have the `_mkdir' function. */
#undef HAVE__MKDIR
/* Define to 1 if you have the `__argz_count' function. */
#undef HAVE___ARGZ_COUNT
/* Define to 1 if you have the `__argz_next' function. */
#undef HAVE___ARGZ_NEXT
/* Define to 1 if you have the `__argz_stringify' function. */
#undef HAVE___ARGZ_STRINGIFY
/* Define to 1 if you have the `__fsetlocking' function. */
#undef HAVE___FSETLOCKING
/* Define as const if the declaration of iconv() needs const. */
#undef ICONV_CONST
/* Define if integer division by zero raises signal SIGFPE. */
#undef INTDIV0_RAISES_SIGFPE
/* Define to 1 if `major', `minor', and `makedev' are declared in <mkdev.h>.
*/
#undef MAJOR_IN_MKDEV
/* Define to 1 if `major', `minor', and `makedev' are declared in
<sysmacros.h>. */
#undef MAJOR_IN_SYSMACROS
/* Define if mkdir takes only one argument. */
#undef MKDIR_TAKES_ONE_ARG
/* Define if you have modern standard-compliant STL streams */
#undef MODERN_STL_STREAMS
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define if <inttypes.h> exists and defines unusable PRI* macros. */
#undef PRI_MACROS_BROKEN
/* Define as the return type of signal handlers (`int' or `void'). */
#undef RETSIGTYPE
/* Define to the type of arg 1 for `select'. */
#undef SELECT_TYPE_ARG1
/* Define to the type of args 2, 3 and 4 for `select'. */
#undef SELECT_TYPE_ARG234
/* Define to the type of arg 5 for `select'. */
#undef SELECT_TYPE_ARG5
/* Define as the maximum value of type 'size_t', if the system doesn't define
it. */
#undef SIZE_MAX
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at run-time.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown */
#undef STACK_DIRECTION
/* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */
#undef STAT_MACROS_BROKEN
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#undef TIME_WITH_SYS_TIME
/* Define as 1 to use the aspell library */
#undef USE_ASPELL
/* Define as 1 if you want to support compressed files. */
#undef USE_COMPRESSION
/* Define as 1 to use an external ispell process for spell-checking */
#undef USE_ISPELL
/* Define if you want to be able to load jpeg images natively */
#undef USE_JPEG_IMAGE_LOADER
/* Define to 1 if LyX should use a MacOS X application bundle file layout */
#undef USE_MACOSX_PACKAGING
/* Define to 1 if LyX should use a POSIX-style file layout */
#undef USE_POSIX_PACKAGING
/* Define as 1 to use the pspell library */
#undef USE_PSPELL
/* Define to 1 if LyX should use a Windows-style file layout */
#undef USE_WINDOWS_PACKAGING
/* Version number of package */
#undef VERSION
/* Define this if you want to see the warning directives put here and there by
the developpers to get attention */
#undef WITH_WARNINGS
/* Define to 1 if the X Window System is missing or not being used. */
#undef X_DISPLAY_MISSING
/* Define to 1 if on AIX 3.
System headers sometimes define this.
We just want to avoid a redefinition error message. */
#ifndef _ALL_SOURCE
# undef _ALL_SOURCE
#endif
/* libstdc++ concept checking */
#undef _GLIBCPP_CONCEPT_CHECKS
/* libstdc++ concept checking */
#undef _GLIBCXX_CONCEPT_CHECKS
/* libstdc++ debug mode */
#undef _GLIBCXX_DEBUG
/* libstdc++ pedantic debug mode */
#undef _GLIBCXX_DEBUG_PEDANTIC
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
/* Define to nothing if your compiler does not understand the 'explicit'
directive */
#undef explicit
/* Define to `int' if <sys/types.h> doesn't define. */
#undef gid_t
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
#undef inline
#endif
/* Define to `int' if <sys/types.h> does not define. */
#undef mode_t
/* Define to `long' if <sys/types.h> does not define. */
#undef off_t
/* Define to `int' if <sys/types.h> does not define. */
#undef pid_t
/* Define as the type of the result of subtracting two pointers, if the system
doesn't define it. */
#undef ptrdiff_t
/* Define to empty if the C compiler doesn't support this keyword. */
#undef signed
/* Define to `unsigned' if <sys/types.h> does not define. */
#undef size_t
/* Define to `int' if <sys/types.h> doesn't define. */
#undef uid_t
/* Define to unsigned long or unsigned long long if <stdint.h> and
<inttypes.h> don't define. */
#undef uintmax_t
/************************************************************
** You should not need to change anything beyond this point */
#ifndef HAVE_STRERROR
#if defined(__cplusplus)
extern "C"
#endif
char * strerror(int n);
#endif
#ifdef HAVE_MKSTEMP
#ifndef HAVE_DECL_MKSTEMP
#if defined(__cplusplus)
extern "C"
#endif
int mkstemp(char*);
#endif
#endif
#ifdef __EMX__
#include "support/os2_defines.h"
#endif
#if defined(HAVE_OSTREAM) && defined(HAVE_LOCALE) && defined(HAVE_SSTREAM)
#define USE_BOOST_FORMAT 1
#else
#define USE_BOOST_FORMAT 0
#endif
#define BOOST_USER_CONFIG <config.h>
#if defined(ENABLE_ASSERTIONS)
#define BOOST_ENABLE_ASSERT_HANDLER 1
#else
#define BOOST_DISABLE_ASSERTS 1
#endif
#define BOOST_DISABLE_THREADS 1
#define BOOST_NO_WREGEX 1
#define BOOST_NO_WSTRING 1
#ifdef __CYGWIN__
#define BOOST_POSIX 1
#endif
#endif
--- config.h.in-thorax 2005-05-02 13:51:52.000000000 +0100
+++ src/config.h.in 2005-04-29 09:27:52.000000000 +0100
@@ -98,6 +98,9 @@
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
+/* Define to 1 if you have the `dup2' function. */
+#undef HAVE_DUP2
+
/* Define to 1 if you have the <flimage.h> header file. */
#undef HAVE_FLIMAGE_H
@@ -231,6 +234,9 @@
/* Define to 1 if you have the `readlink' function. */
#undef HAVE_READLINK
+/* Define to 1 if you have the `select' function. */
+#undef HAVE_SELECT
+
/* Define to 1 if you have the `setenv' function. */
#undef HAVE_SETENV
@@ -240,6 +246,9 @@
/* Define to 1 if you have the `snprintf' function. */
#undef HAVE_SNPRINTF
+/* Define to 1 if you have the `socket' function. */
+#undef HAVE_SOCKET
+
/* Define to 1 if you have the <sstream> header file. */
#undef HAVE_SSTREAM
@@ -429,6 +438,9 @@
/* Define as 1 if you want to support compressed files. */
#undef USE_COMPRESSION
+/* Define as 1 to use an external ispell process for spell-checking */
+#undef USE_ISPELL
+
/* Define if you want to be able to load jpeg images natively */
#undef USE_JPEG_IMAGE_LOADER
// os_win32.h copyright "Ruurd A. Reitsma" <[EMAIL PROTECTED]>
#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_