diff options
| author | Geoff Voelker | 1995-06-30 21:12:37 +0000 |
|---|---|---|
| committer | Geoff Voelker | 1995-06-30 21:12:37 +0000 |
| commit | 051fe60dc47c956ea47f9640a7ed6855fb676ddc (patch) | |
| tree | aa6017bf3aa5bd3ecbaf0ec7d44fa4d7ef48cd00 /src | |
| parent | 7a8b824c1eb4cc59e10abe40749eaa8f50ca2b40 (diff) | |
| download | emacs-051fe60dc47c956ea47f9640a7ed6855fb676ddc.tar.gz emacs-051fe60dc47c956ea47f9640a7ed6855fb676ddc.zip | |
(PASSWD_FIELD_SIZE): Defined.
(the_passwd_name, the_passwd_passwd, the_passwd_gecos,
the_passwd_dir, the_passwd_shell, getpwuid): Use PASSWD_FIELD_SIZE.
(get_emacs_configuration): Check if processor macros are defined.
Diffstat (limited to 'src')
| -rw-r--r-- | src/w32.c | 27 |
1 files changed, 21 insertions, 6 deletions
| @@ -206,11 +206,13 @@ readdir (DIR *dirp) | |||
| 206 | 206 | ||
| 207 | int getuid (); /* forward declaration */ | 207 | int getuid (); /* forward declaration */ |
| 208 | 208 | ||
| 209 | static char the_passwd_name[256]; | 209 | #define PASSWD_FIELD_SIZE 256 |
| 210 | static char the_passwd_passwd[256]; | 210 | |
| 211 | static char the_passwd_gecos[256]; | 211 | static char the_passwd_name[PASSWD_FIELD_SIZE]; |
| 212 | static char the_passwd_dir[256]; | 212 | static char the_passwd_passwd[PASSWD_FIELD_SIZE]; |
| 213 | static char the_passwd_shell[256]; | 213 | static char the_passwd_gecos[PASSWD_FIELD_SIZE]; |
| 214 | static char the_passwd_dir[PASSWD_FIELD_SIZE]; | ||
| 215 | static char the_passwd_shell[PASSWD_FIELD_SIZE]; | ||
| 214 | 216 | ||
| 215 | static struct passwd the_passwd = | 217 | static struct passwd the_passwd = |
| 216 | { | 218 | { |
| @@ -227,7 +229,7 @@ static struct passwd the_passwd = | |||
| 227 | struct passwd * | 229 | struct passwd * |
| 228 | getpwuid (int uid) | 230 | getpwuid (int uid) |
| 229 | { | 231 | { |
| 230 | int size = 256; | 232 | int size = PASSWD_FIELD_SIZE; |
| 231 | 233 | ||
| 232 | if (!GetUserName (the_passwd.pw_name, &size)) | 234 | if (!GetUserName (the_passwd.pw_name, &size)) |
| 233 | return NULL; | 235 | return NULL; |
| @@ -273,22 +275,35 @@ get_emacs_configuration (void) | |||
| 273 | /* Determine the processor type. */ | 275 | /* Determine the processor type. */ |
| 274 | switch (get_processor_type ()) | 276 | switch (get_processor_type ()) |
| 275 | { | 277 | { |
| 278 | |||
| 279 | #ifdef PROCESSOR_INTEL_386 | ||
| 276 | case PROCESSOR_INTEL_386: | 280 | case PROCESSOR_INTEL_386: |
| 277 | case PROCESSOR_INTEL_486: | 281 | case PROCESSOR_INTEL_486: |
| 278 | case PROCESSOR_INTEL_PENTIUM: | 282 | case PROCESSOR_INTEL_PENTIUM: |
| 279 | arch = "i386"; | 283 | arch = "i386"; |
| 280 | break; | 284 | break; |
| 285 | #endif | ||
| 286 | |||
| 287 | #ifdef PROCESSOR_INTEL_860 | ||
| 281 | case PROCESSOR_INTEL_860: | 288 | case PROCESSOR_INTEL_860: |
| 282 | arch = "i860"; | 289 | arch = "i860"; |
| 283 | break; | 290 | break; |
| 291 | #endif | ||
| 292 | |||
| 293 | #ifdef PROCESSOR_MIPS_R2000 | ||
| 284 | case PROCESSOR_MIPS_R2000: | 294 | case PROCESSOR_MIPS_R2000: |
| 285 | case PROCESSOR_MIPS_R3000: | 295 | case PROCESSOR_MIPS_R3000: |
| 286 | case PROCESSOR_MIPS_R4000: | 296 | case PROCESSOR_MIPS_R4000: |
| 287 | arch = "mips"; | 297 | arch = "mips"; |
| 288 | break; | 298 | break; |
| 299 | #endif | ||
| 300 | |||
| 301 | #ifdef PROCESSOR_ALPHA_21064 | ||
| 289 | case PROCESSOR_ALPHA_21064: | 302 | case PROCESSOR_ALPHA_21064: |
| 290 | arch = "alpha"; | 303 | arch = "alpha"; |
| 291 | break; | 304 | break; |
| 305 | #endif | ||
| 306 | |||
| 292 | default: | 307 | default: |
| 293 | arch = "unknown"; | 308 | arch = "unknown"; |
| 294 | break; | 309 | break; |