1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-03 08:30:09 +00:00

(w32_strerror): New function.

This commit is contained in:
Andrew Innes 2000-12-18 23:50:26 +00:00
parent ec6bd013e5
commit 18e070ac54

View File

@ -97,6 +97,25 @@ extern Lisp_Object Vw32_generate_fake_inodes;
extern Lisp_Object Vw32_get_true_file_attributes;
extern Lisp_Object Vw32_num_mouse_buttons;
/* Equivalent of strerror for W32 error codes. */
char *
w32_strerror (int error_no)
{
static char buf[500];
if (error_no == 0)
error_no = GetLastError ();
buf[0] = '\0';
if (!FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM, NULL,
error_no,
0, /* choose most suitable language */
buf, sizeof (buf), NULL))
sprintf (buf, "w32 error %u", error_no);
return buf;
}
static char startup_dir[MAXPATHLEN];
/* Get the current working directory. */