changeset 24885:5f1b1f5fd7c8

(get_emacs_configuration): Use GetVersionEx to handle NT5.0 correctly. Include build number in configuration. w32heap.c (osinfo_cache): New variable.
author Geoff Voelker <voelker@cs.washington.edu>
date Thu, 24 Jun 1999 22:05:14 +0000
parents 1e6ee49f9474
children fb9574318fa0
files src/w32.c
diffstat 1 files changed, 32 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/w32.c	Thu Jun 24 18:04:46 1999 +0000
+++ b/src/w32.c	Thu Jun 24 22:05:14 1999 +0000
@@ -789,6 +789,7 @@
 get_emacs_configuration (void)
 {
   char *arch, *oem, *os;
+  int build_num;
 
   /* Determine the processor type.  */
   switch (get_processor_type ()) 
@@ -830,10 +831,37 @@
   /* Let oem be "*" until we figure out how to decode the OEM field.  */
   oem = "*";
 
-  os = (GetVersion () & OS_WIN95) ? "windows95" : "nt";
-
-  sprintf (configuration_buffer, "%s-%s-%s%d.%d", arch, oem, os,
-	   get_w32_major_version (), get_w32_minor_version ());
+  switch (osinfo_cache.dwPlatformId) {
+  case VER_PLATFORM_WIN32_NT:
+    os = "nt";
+    build_num = osinfo_cache.dwBuildNumber;
+    break;
+  case VER_PLATFORM_WIN32_WINDOWS:
+    if (osinfo_cache.dwMinorVersion == 0) {
+      os = "windows95";
+    } else {
+      os = "windows98";
+    }
+    build_num = LOWORD (osinfo_cache.dwBuildNumber);
+    break;
+  case VER_PLATFORM_WIN32s:
+    /* Not supported, should not happen. */
+    os = "windows32s";
+    build_num = LOWORD (osinfo_cache.dwBuildNumber);
+    break;
+  default:
+    os = "unknown";
+    build_num = 0;
+    break;
+  }
+
+  if (osinfo_cache.dwPlatformId == VER_PLATFORM_WIN32_NT) {
+    sprintf (configuration_buffer, "%s-%s-%s%d.%d.%d", arch, oem, os,
+	     get_w32_major_version (), get_w32_minor_version (), build_num);
+  } else {
+    sprintf (configuration_buffer, "%s-%s-%s.%d", arch, oem, os, build_num);
+  }
+
   return configuration_buffer;
 }