#include <sys/personality.h>
#endif
+#ifdef HAVE_LIBXML2
+#include <libxml/parser.h>
+#endif
+
#ifndef O_RDWR
#define O_RDWR 2
#endif
#else
int gdb_use_union EXTERNALLY_VISIBLE = 1;
#endif
-EMACS_INT gdb_valbits EXTERNALLY_VISIBLE = VALBITS;
-EMACS_INT gdb_gctypebits EXTERNALLY_VISIBLE = GCTYPEBITS;
+int gdb_valbits EXTERNALLY_VISIBLE = VALBITS;
+int gdb_gctypebits EXTERNALLY_VISIBLE = GCTYPEBITS;
#if defined (DATA_SEG_BITS) && ! defined (USE_LSB_TAG)
-EMACS_INT gdb_data_seg_bits EXTERNALLY_VISIBLE = DATA_SEG_BITS;
+uintptr_t gdb_data_seg_bits EXTERNALLY_VISIBLE = DATA_SEG_BITS;
#else
-EMACS_INT gdb_data_seg_bits EXTERNALLY_VISIBLE = 0;
+uintptr_t gdb_data_seg_bits EXTERNALLY_VISIBLE = 0;
#endif
-EMACS_INT PVEC_FLAG EXTERNALLY_VISIBLE = PSEUDOVECTOR_FLAG;
-EMACS_INT gdb_array_mark_flag EXTERNALLY_VISIBLE = ARRAY_MARK_FLAG;
+ptrdiff_t PVEC_FLAG EXTERNALLY_VISIBLE = PSEUDOVECTOR_FLAG;
+ptrdiff_t gdb_array_mark_flag EXTERNALLY_VISIBLE = ARRAY_MARK_FLAG;
/* GDB might say "No enum type named pvec_type" if we don't have at
least one symbol with that type, and then xbacktrace could fail. */
enum pvec_type gdb_pvec_type EXTERNALLY_VISIBLE = PVEC_TYPE_MASK;
Lisp_Object Qrisky_local_variable;
+Lisp_Object Qkill_emacs;
+
/* If non-zero, Emacs should not attempt to use a window-specific code,
but instead should use the virtual terminal under which it was started. */
int inhibit_window_system;
data on the first attempt to change it inside asynchronous code. */
int running_asynch_code;
-#if defined(HAVE_X_WINDOWS) || defined(HAVE_NS)
+#if defined (HAVE_X_WINDOWS) || defined (HAVE_NS)
/* If non-zero, -d was specified, meaning we're using some window system. */
int display_arg;
#endif
Tells GC how to save a copy of the stack. */
char *stack_bottom;
+#if defined (DOUG_LEA_MALLOC) || defined (GNU_LINUX)
/* The address where the heap starts (from the first sbrk (0) call). */
static void *my_heap_start;
+#endif
#ifdef GNU_LINUX
/* The gap between BSS end and heap start as far as we can tell. */
{
register int i;
Lisp_Object name, dir, handler;
- int count = SPECPDL_INDEX ();
+ ptrdiff_t count = SPECPDL_INDEX ();
Lisp_Object raw_name;
initial_argv = argv;
{
static char heapexec[] = "EMACS_HEAP_EXEC=true";
/* Set this so we only do this once. */
- putenv(heapexec);
+ putenv (heapexec);
/* A flag to turn off address randomization which is introduced
in linux kernel shipped with fedora core 4 */
stack allocation routine for new process that the allocation
fails if stack limit is not on page boundary. So, round up the
new limit to page boundary. */
- newlim = (newlim + getpagesize () - 1) / getpagesize () * getpagesize();
+ newlim = (newlim + getpagesize () - 1) / getpagesize () * getpagesize ();
#endif
if (newlim > rlim.rlim_max)
{
if (!dname_arg || !strchr (dname_arg, '\n'))
{ /* In orig, child: now exec w/special daemon name. */
char fdStr[80];
+ int fdStrlen =
+ snprintf (fdStr, sizeof fdStr,
+ "--daemon=\n%d,%d\n%s", daemon_pipe[0],
+ daemon_pipe[1], dname_arg ? dname_arg : "");
- if (dname_arg && strlen (dname_arg) > 70)
+ if (! (0 <= fdStrlen && fdStrlen < sizeof fdStr))
{
fprintf (stderr, "daemon: child name too long\n");
exit (1);
}
- sprintf (fdStr, "--daemon=\n%d,%d\n%s", daemon_pipe[0],
- daemon_pipe[1], dname_arg ? dname_arg : "");
argv[skip_args] = fdStr;
execv (argv[0], argv);
|| strlen (dname_arg) < 1 || strlen (dname_arg) > 70)
{
fprintf (stderr, "emacs daemon: daemon name absent or too long\n");
- exit(1);
+ exit (1);
}
dname_arg2[0] = '\0';
sscanf (dname_arg, "\n%d,%d\n%s", &(daemon_pipe[0]), &(daemon_pipe[1]),
fcntl (daemon_pipe[1], F_SETFD, FD_CLOEXEC);
#ifdef HAVE_SETSID
- setsid();
+ setsid ();
#endif
#else /* DOS_NT */
fprintf (stderr, "This platform does not support the -daemon flag.\n");
= argmatch (argv, argc, "-nsl", "--no-site-lisp", 11, NULL, &skip_args);
#ifdef HAVE_NS
- ns_alloc_autorelease_pool();
+ ns_alloc_autorelease_pool ();
if (!noninteractive)
{
#ifdef NS_IMPL_COCOA
{
/* FIXME: Do the right thing if getenv returns NULL, or if
chdir fails. */
- if (!strncmp(argv[skip_args], "-psn", 4))
+ if (!strncmp (argv[skip_args], "-psn", 4))
{
skip_args += 1;
chdir (getenv ("HOME"));
}
- else if (skip_args+1 < argc && !strncmp(argv[skip_args+1], "-psn", 4))
+ else if (skip_args+1 < argc && !strncmp (argv[skip_args+1], "-psn", 4))
{
skip_args += 2;
chdir (getenv ("HOME"));
#endif
/* argmatch must not be used after here,
- except when bulding temacs
+ except when building temacs
because the -d argument has not been skipped in skip_args. */
#ifdef MSDOS
#ifdef MSDOS
syms_of_xmenu ();
- syms_of_dosfns();
- syms_of_msdos();
- syms_of_win16select();
+ syms_of_dosfns ();
+ syms_of_msdos ();
+ syms_of_win16select ();
#endif /* MSDOS */
#ifdef HAVE_NS
/* Initialization that must be done even if the global variable
initialized is non zero. */
#ifdef HAVE_NTGUI
+ globals_of_w32font ();
globals_of_w32fns ();
globals_of_w32menu ();
globals_of_w32select ();
GNU/Linux and MinGW. It might work on some other systems too.
Give it a try and tell us if it works on your system. To compile
for profiling, use the configure option --enable-profiling. */
-#if defined (__FreeBSD__) || defined (GNU_LINUX) || defined(__MINGW32__)
+#if defined (__FreeBSD__) || defined (GNU_LINUX) || defined (__MINGW32__)
#ifdef PROFILING
if (initialized)
{
{
struct gcpro gcpro1;
Lisp_Object hook;
+ int exit_code;
GCPRO1 (arg);
if (STRINGP (Vauto_save_list_file_name))
unlink (SSDATA (Vauto_save_list_file_name));
- exit (INTEGERP (arg) ? XINT (arg) : EXIT_SUCCESS);
+ if (INTEGERP (arg))
+ exit_code = (XINT (arg) < 0
+ ? XINT (arg) | INT_MIN
+ : XINT (arg) & INT_MAX);
+ else if (noninteractive && (fflush (stdout) || ferror (stdout)))
+ exit_code = EXIT_FAILURE;
+ else
+ exit_code = EXIT_SUCCESS;
+ exit (exit_code);
}
#ifdef HAVE_NS
ns_term_shutdown (sig);
#endif
+
+#ifdef HAVE_LIBXML2
+ xmlCleanupParser ();
+#endif
}
{
Lisp_Object tem;
Lisp_Object symbol;
- int count = SPECPDL_INDEX ();
+ ptrdiff_t count = SPECPDL_INDEX ();
check_pure_size ();
{
DEFSYM (Qfile_name_handler_alist, "file-name-handler-alist");
DEFSYM (Qrisky_local_variable, "risky-local-variable");
+ DEFSYM (Qkill_emacs, "kill-emacs");
#ifndef CANNOT_DUMP
defsubr (&Sdump_emacs);