#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 */
/* Ensure HOME and SHELL are defined. */
if (getenv ("HOME") == NULL)
- abort ();
+ emacs_abort ();
if (getenv ("SHELL") == NULL)
- abort ();
+ emacs_abort ();
/* Set dir and shell from environment variables. */
strcpy (dflt_passwd.pw_dir, getenv ("HOME"));
}
/* Routines that are no-ops on NT but are defined to get Emacs to compile. */
-
-int
-sigsetmask (int signal_mask)
-{
- return 0;
-}
-
-int
-sigmask (int sig)
-{
- return 0;
-}
-
-int
-sigblock (int sig)
-{
- return 0;
-}
-
-int
-sigunblock (int sig)
-{
- return 0;
-}
-
int
sigemptyset (sigset_t *set)
{
+ *set = 0;
return 0;
}
char modname[MAX_PATH];
if (!GetModuleFileName (NULL, modname, MAX_PATH))
- abort ();
+ emacs_abort ();
if ((p = strrchr (modname, '\\')) == NULL)
- abort ();
+ emacs_abort ();
*p = 0;
if ((p = strrchr (modname, '\\')) && xstrcasecmp (p, "\\bin") == 0)
/* FIXME: Do we need to resolve possible symlinks in startup_dir?
Does it matter anywhere in Emacs? */
if (!GetCurrentDirectory (MAXPATHLEN, startup_dir))
- abort ();
+ emacs_abort ();
{
static char modname[MAX_PATH];
if (!GetModuleFileName (NULL, modname, MAX_PATH))
- abort ();
+ emacs_abort ();
argv[0] = modname;
}
p = getenv ("emacs_dir");
if (p == NULL)
- abort ();
+ emacs_abort ();
strcpy (root_dir, p);
root_dir[parse_root (root_dir, NULL)] = '\0';
dostounix_filename (root_dir);
doesn't resolve aliasing due to subst commands, or recognize hard
links. */
if (!w32_get_long_filename ((char *)name, fullname, MAX_PATH))
- abort ();
+ emacs_abort ();
parse_root (fullname, &p);
/* Normal W32 filesystems are still case insensitive. */
dir_access = sys_access (filename, D_OK);
/* Since Windows distinguishes between symlinks to directories and
- to files, we provide a kludgey feature: if FILENAME doesn't
+ to files, we provide a kludgy feature: if FILENAME doesn't
exist, but ends in a slash, we create a symlink to directory. If
FILENAME exists and is a directory, we always create a symlink to
directory. */
whether the underlying volume actually supports symlinks, by
testing the FILE_SUPPORTS_REPARSE_POINTS bit in volume's flags, and
avoid the call to this function if it doesn't. That's because the
- call to GetFileAttributes takes a non-negligible time, expecially
+ call to GetFileAttributes takes a non-negligible time, especially
on non-local or removable filesystems. See stat_worker for an
example of how to do that. */
static int
if (fd_info[ fd ].cp != NULL)
{
DebPrint (("sys_socket: fd_info[%d] apparently in use!\n", fd));
- abort ();
+ emacs_abort ();
}
fd_info[ fd ].cp = cp;
{
if (fd_info[fd].flags & FILE_SOCKET)
{
- if (winsock_lib == NULL) abort ();
+ if (winsock_lib == NULL) emacs_abort ();
pfn_shutdown (SOCK_HANDLE (fd), 2);
rc = pfn_closesocket (SOCK_HANDLE (fd));
|| (fd_info[fd].flags & FILE_READ) == 0)
{
DebPrint (("_sys_read_ahead: internal error: fd %d is not a pipe, serial port, or socket!\n", fd));
- abort ();
+ emacs_abort ();
}
cp->status = STATUS_READ_IN_PROGRESS;
/* re-read CR carried over from last read */
if (fd_info[fd].flags & FILE_LAST_CR)
{
- if (fd_info[fd].flags & FILE_BINARY) abort ();
+ if (fd_info[fd].flags & FILE_BINARY) emacs_abort ();
*buffer++ = 0x0d;
count--;
nchars++;
}
else /* FILE_SOCKET */
{
- if (winsock_lib == NULL) abort ();
+ if (winsock_lib == NULL) emacs_abort ();
/* do the equivalent of a non-blocking read */
pfn_ioctlsocket (SOCK_HANDLE (fd), FIONREAD, &waiting);
else if (fd < MAXDESC && fd_info[fd].flags & FILE_SOCKET)
{
unsigned long nblock = 0;
- if (winsock_lib == NULL) abort ();
+ if (winsock_lib == NULL) emacs_abort ();
/* TODO: implement select() properly so non-blocking I/O works. */
/* For now, make sure the write blocks. */
Lisp_Object Vlibrary_cache;
-/* The argument LIBRARIES is an alist that associates a symbol
- LIBRARY_ID, identifying an external DLL library known to Emacs, to
- a list of filenames under which the library is usually found. In
- most cases, the argument passed as LIBRARIES is the variable
- `dynamic-library-alist', which is initialized to a list of common
- library names. If the function loads the library successfully, it
- returns the handle of the DLL, and records the filename in the
- property :loaded-from of LIBRARY_ID; it returns NULL if the library
- could not be found, or when it was already loaded (because the
- handle is not recorded anywhere, and so is lost after use). It
- would be trivial to save the handle too in :loaded-from, but
- currently there's no use case for it. */
+/* Try loading LIBRARY_ID from the file(s) specified in
+ Vdynamic_library_alist. If the library is loaded successfully,
+ return the handle of the DLL, and record the filename in the
+ property :loaded-from of LIBRARY_ID. If the library could not be
+ found, or when it was already loaded (because the handle is not
+ recorded anywhere, and so is lost after use), return NULL.
+
+ We could also save the handle in :loaded-from, but currently
+ there's no use case for it. */
HMODULE
-w32_delayed_load (Lisp_Object libraries, Lisp_Object library_id)
+w32_delayed_load (Lisp_Object library_id)
{
HMODULE library_dll = NULL;
CHECK_SYMBOL (library_id);
- if (CONSP (libraries) && NILP (Fassq (library_id, Vlibrary_cache)))
+ if (CONSP (Vdynamic_library_alist)
+ && NILP (Fassq (library_id, Vlibrary_cache)))
{
Lisp_Object found = Qnil;
- Lisp_Object dlls = Fassq (library_id, libraries);
+ Lisp_Object dlls = Fassq (library_id, Vdynamic_library_alist);
if (CONSP (dlls))
for (dlls = XCDR (dlls); CONSP (dlls); dlls = XCDR (dlls))
buffer,
"Emacs Abort Dialog",
MB_OK | MB_ICONEXCLAMATION | MB_TASKMODAL);
- /* Use the low-level Emacs abort. */
-#undef abort
+ /* Use the low-level system abort. */
abort ();
}
else
}
void
-term_ntproc (void)
+term_ntproc (int ignored)
{
+ (void)ignored;
/* shutdown the socket interface if necessary */
term_winsock ();
}
void
-init_ntproc (void)
+init_ntproc (int dumping)
{
/* Initialize the socket interface now if available and requested by
the user by defining PRELOAD_WINSOCK; otherwise loading will be
/* unfortunately, atexit depends on implementation of malloc */
/* atexit (term_ntproc); */
- signal (SIGABRT, term_ntproc);
+ if (!dumping)
+ signal (SIGABRT, term_ntproc);
/* determine which drives are fixed, for GetCachedVolumeInformation */
{
|| type == CTRL_SHUTDOWN_EVENT) /* User shutsdown. */
{
/* Shut down cleanly, making sure autosave files are up to date. */
- shut_down_emacs (0, 0, Qnil);
+ shut_down_emacs (0, Qnil);
}
/* Allow other handlers to handle this signal. */
error ("SetCommState() failed");
childp2 = Fplist_put (childp2, QCsummary, build_string (summary));
- PSET (p, childp, childp2);
+ pset_childp (p, childp2);
}
#ifdef HAVE_GNUTLS