diff options
| author | Andrew Innes | 2000-12-18 23:50:26 +0000 |
|---|---|---|
| committer | Andrew Innes | 2000-12-18 23:50:26 +0000 |
| commit | 18e070ac54fd583e435b2200fed805fa94a4268d (patch) | |
| tree | 6793b3adff01254985b9d28eca18639aac27787e /src | |
| parent | ec6bd013e579a39915916e327662d0309277a9e2 (diff) | |
| download | emacs-18e070ac54fd583e435b2200fed805fa94a4268d.tar.gz emacs-18e070ac54fd583e435b2200fed805fa94a4268d.zip | |
(w32_strerror): New function.
Diffstat (limited to 'src')
| -rw-r--r-- | src/w32.c | 19 |
1 files changed, 19 insertions, 0 deletions
| @@ -97,6 +97,25 @@ extern Lisp_Object Vw32_generate_fake_inodes; | |||
| 97 | extern Lisp_Object Vw32_get_true_file_attributes; | 97 | extern Lisp_Object Vw32_get_true_file_attributes; |
| 98 | extern Lisp_Object Vw32_num_mouse_buttons; | 98 | extern Lisp_Object Vw32_num_mouse_buttons; |
| 99 | 99 | ||
| 100 | |||
| 101 | /* Equivalent of strerror for W32 error codes. */ | ||
| 102 | char * | ||
| 103 | w32_strerror (int error_no) | ||
| 104 | { | ||
| 105 | static char buf[500]; | ||
| 106 | |||
| 107 | if (error_no == 0) | ||
| 108 | error_no = GetLastError (); | ||
| 109 | |||
| 110 | buf[0] = '\0'; | ||
| 111 | if (!FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM, NULL, | ||
| 112 | error_no, | ||
| 113 | 0, /* choose most suitable language */ | ||
| 114 | buf, sizeof (buf), NULL)) | ||
| 115 | sprintf (buf, "w32 error %u", error_no); | ||
| 116 | return buf; | ||
| 117 | } | ||
| 118 | |||
| 100 | static char startup_dir[MAXPATHLEN]; | 119 | static char startup_dir[MAXPATHLEN]; |
| 101 | 120 | ||
| 102 | /* Get the current working directory. */ | 121 | /* Get the current working directory. */ |