]> code.delx.au - gnu-emacs/blobdiff - src/w32.c
[HAVE_NTGUI] (FRAME_TERMCAP_P): Don't redefine.
[gnu-emacs] / src / w32.c
index 12da76bb61db58cc9f372eeabb9ff4573a641312..da286ec781151ec1b8b97a66384a8b2289ca91ae 100644 (file)
--- a/src/w32.c
+++ b/src/w32.c
@@ -206,11 +206,13 @@ readdir (DIR *dirp)
 
 int getuid (); /* forward declaration */
 
-static char the_passwd_name[256];
-static char the_passwd_passwd[256];
-static char the_passwd_gecos[256];
-static char the_passwd_dir[256];
-static char the_passwd_shell[256];
+#define PASSWD_FIELD_SIZE 256
+
+static char the_passwd_name[PASSWD_FIELD_SIZE];
+static char the_passwd_passwd[PASSWD_FIELD_SIZE];
+static char the_passwd_gecos[PASSWD_FIELD_SIZE];
+static char the_passwd_dir[PASSWD_FIELD_SIZE];
+static char the_passwd_shell[PASSWD_FIELD_SIZE];
 
 static struct passwd the_passwd = 
 {
@@ -227,7 +229,7 @@ static struct passwd the_passwd =
 struct passwd *
 getpwuid (int uid)
 {
-  int size = 256;
+  int size = PASSWD_FIELD_SIZE;
   
   if (!GetUserName (the_passwd.pw_name, &size))
     return NULL;
@@ -268,44 +270,57 @@ static char configuration_buffer[32];
 char *
 get_emacs_configuration (void)
 {
-    char *arch, *oem, *os;
-
-    /* Determine the processor type.  */
-    switch (get_processor_type ()) 
-      {
-      case PROCESSOR_INTEL_386:
-      case PROCESSOR_INTEL_486:
-      case PROCESSOR_INTEL_PENTIUM:
-       arch = "i386";
-       break;
-      case PROCESSOR_INTEL_860:
-       arch = "i860";
-       break;
-      case PROCESSOR_MIPS_R2000:
-      case PROCESSOR_MIPS_R3000:
-      case PROCESSOR_MIPS_R4000:
-       arch = "mips";
-       break;
-      case PROCESSOR_ALPHA_21064:
-       arch = "alpha";
-       break;
-      default:
-       arch = "unknown";
-       break;
-      }
-
-    /* Let oem be "*" until we figure out how to decode the OEM field.  */
-    oem = "*";
+  char *arch, *oem, *os;
+
+  /* Determine the processor type.  */
+  switch (get_processor_type ()) 
+    {
+
+#ifdef PROCESSOR_INTEL_386
+    case PROCESSOR_INTEL_386:
+    case PROCESSOR_INTEL_486:
+    case PROCESSOR_INTEL_PENTIUM:
+      arch = "i386";
+      break;
+#endif
+
+#ifdef PROCESSOR_INTEL_860
+    case PROCESSOR_INTEL_860:
+      arch = "i860";
+      break;
+#endif
+
+#ifdef PROCESSOR_MIPS_R2000
+    case PROCESSOR_MIPS_R2000:
+    case PROCESSOR_MIPS_R3000:
+    case PROCESSOR_MIPS_R4000:
+      arch = "mips";
+      break;
+#endif
+
+#ifdef PROCESSOR_ALPHA_21064
+    case PROCESSOR_ALPHA_21064:
+      arch = "alpha";
+      break;
+#endif
+
+    default:
+      arch = "unknown";
+      break;
+    }
+
+  /* Let oem be "*" until we figure out how to decode the OEM field.  */
+  oem = "*";
 
 #ifdef WINDOWS95
-    os = "win";
+  os = "win";
 #else
-    os = "nt";
+  os = "nt";
 #endif
 
-    sprintf (configuration_buffer, "%s-%s-%s%d.%d", arch, oem, os,
-            get_nt_major_version (), get_nt_minor_version ());
-    return configuration_buffer;
+  sprintf (configuration_buffer, "%s-%s-%s%d.%d", arch, oem, os,
+          get_nt_major_version (), get_nt_minor_version ());
+  return configuration_buffer;
 }
 
 /* Conjure up inode and device numbers that will serve the purpose