AC_SUBST(NS_OBJ)
AC_SUBST(NS_OBJC_OBJ)
AC_SUBST(LIB_STANDARD)
- AC_SUBST_FILE(ns_frag)
+HAVE_W32=no
+W32_OBJ=
+W32_LIBS=
+if test "${with_w32}" != no; then
+ if test "${opsys}" != "cygwin"; then
+ AC_MSG_ERROR([Using w32 with an autotools build is only supported for Cygwin.])
+ fi
+ AC_CHECK_HEADER([windows.h], [HAVE_W32=yes],
+ [AC_MSG_ERROR([`--with-w32' was specified, but windows.h
+ cannot be found.])])
+ AC_DEFINE(HAVE_NTGUI, 1, [Define to use native Windows GUI.])
+ W32_OBJ="w32fns.o w32menu.o w32reg.o w32font.o w32term.o"
+ W32_OBJ="$W32_OBJ w32xfns.o w32select.o w32uniscribe.o"
+ W32_LIBS="$W32_LIBS -lkernel32 -luser32 -lgdi32 -lole32 -lcomdlg32"
+ W32_LIBS="$W32_LIBS -lusp10 -lcomctl32 -lwinspool"
+fi
+AC_SUBST(W32_OBJ)
+AC_SUBST(W32_LIBS)
+
+if test "${HAVE_W32}" = "yes"; then
+ window_system=w32
+ with_xft=no
+fi
+
## $window_system is now set to the window system we will
## ultimately use.
static uprintmax_t heap_bss_diff;
#endif
- /* Nonzero means running Emacs without interactive terminal. */
- int noninteractive;
+/* To run as a daemon under Cocoa or Windows, we must do a fork+exec,
+ not a simple fork.
+
+ On Cocoa, CoreFoundation lib fails in forked process:
+ http://developer.apple.com/ReleaseNotes/
+ CoreFoundation/CoreFoundation.html)
+
+ On Windows, a Cygwin fork child cannot access the USER subsystem.
+
+ We mark being in the exec'd process by a daemon name argument of
+ form "--daemon=\nFD0,FD1\nNAME" where FD are the pipe file descriptors,
+ NAME is the original daemon name, if any. */
+#if defined (NS_IMPL_COCOA) || defined (HAVE_NTGUI)
+# define DAEMON_MUST_EXEC
+#endif
+
+ /* True means running Emacs without interactive terminal. */
+ bool noninteractive;
- /* Nonzero means remove site-lisp directories from load-path. */
- int no_site_lisp;
+ /* True means remove site-lisp directories from load-path. */
+ bool no_site_lisp;
/* Name for the server started by the daemon.*/
static char *daemon_name;
#ifdef HAVE_SETRLIMIT
struct rlimit rlim;
#endif
- int no_loadup = 0;
+ bool no_loadup = 0;
char *junk = 0;
char *dname_arg = 0;
-#ifdef NS_IMPL_COCOA
+#ifdef DAEMON_MUST_EXEC
char dname_arg2[80];
-#endif
+#endif /* DAEMON_MUST_EXEC */
char *ch_to_dir;
+ struct sigaction fatal_error_action;
#if GC_MARK_STACK
stack_base = &dummy;
static void x_emboss (struct frame *, struct image *);
static int x_build_heuristic_mask (struct frame *, struct image *,
Lisp_Object);
-#ifdef HAVE_NTGUI
+#ifdef WINDOWSNT
+extern Lisp_Object Vlibrary_cache;
-
#define CACHE_IMAGE_TYPE(type, status) \
do { Vlibrary_cache = Fcons (Fcons (type, status), Vlibrary_cache); } while (0)
#else
#define fn_png_set_longjmp_fn png_set_longjmp_fn
#endif /* libpng version >= 1.5 */
-#endif /* HAVE_NTGUI */
+#endif /* WINDOWSNT */
+ /* Possibly inefficient/inexact substitutes for _setjmp and _longjmp.
+ Do not use sys_setjmp, as PNG supports only jmp_buf. The _longjmp
+ substitute may munge the signal mask, but that should be OK here.
+ MinGW (MS-Windows) uses _setjmp and defines setjmp to _setjmp in
+ the system header setjmp.h; don't mess up that. */
+ #ifndef HAVE__SETJMP
+ # define _setjmp(j) setjmp (j)
+ # define _longjmp longjmp
+ #endif
#if (PNG_LIBPNG_VER < 10500)
- #define PNG_LONGJMP(ptr) (longjmp ((ptr)->jmpbuf, 1))
+ #define PNG_LONGJMP(ptr) (_longjmp ((ptr)->jmpbuf, 1))
#define PNG_JMPBUF(ptr) ((ptr)->jmpbuf)
#else
/* In libpng version 1.5, the jmpbuf member is hidden. (Bug#7908) */
#ifdef subprocesses
if (kbd_on_hold_p () && kbd_buffer_nr_stored () < KBD_BUFFER_SIZE/4)
{
- /* Start reading input again, we have processed enough so we can
- accept new events again. */
+ /* Start reading input again because we have processed enough to
+ be able to accept new events again. */
unhold_keyboard_input ();
- #ifdef SIGIO
+ #ifdef USABLE_SIGIO
if (!noninteractive)
- signal (SIGIO, input_available_signal);
- #endif /* SIGIO */
+ {
+ struct sigaction action;
+ emacs_sigaction_init (&action, deliver_input_available_signal);
+ sigaction (SIGIO, &action, 0);
+ }
+ #endif
start_polling ();
}
#endif /* subprocesses */
#include <sys/file.h>
#include <sys/time.h>
#include <sys/utime.h>
-#include <mbstring.h> /* for _mbspbrk */
#include <math.h>
- #include <setjmp.h>
#include <time.h>
/* must include CRT headers *before* config.h */
#include <config.h>
#include <signal.h>
#include <stdio.h>
- #include <setjmp.h>
+
#include "lisp.h"
#include "keyboard.h"
#include "frame.h"