incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Liviu Nicoara <nico...@roguewave.com>
Subject [PATCH] UNAME.cpp Windows [limited] support
Date Tue, 19 Jul 2005 22:09:13 GMT
Index: etc/config/src/UNAME.cpp
===================================================================
--- etc/config/src/UNAME.cpp    (revision 219737)
+++ etc/config/src/UNAME.cpp    (working copy)
@@ -103,8 +103,27 @@

 #else

-    return 1;
+    OSVERSIONINFO osinfo;
+    osinfo.dwOSVersionInfoSize = sizeof osinfo;

+    if (!::GetVersionEx (&osinfo))
+        return 1;
+
+    printf ("#define _RWSTD_OS_WINDOWS\n");
+    printf ("#define _RWSTD_OS_SYSNAME \"WINDOWS\"\n");
+
+    // no micro on Windows
+    printf ("#define _RWSTD_OS_RELEASE \"%d.%d\"\n",
+            osinfo.dwMajorVersion,
+            osinfo.dwMinorVersion);
+
+    printf ("#define _RWSTD_OS_MAJOR %lu\n", osinfo.dwMajorVersion);
+    printf ("#define _RWSTD_OS_MINOR %lu\n", osinfo.dwMinorVersion);
+
+    // not applicable
+    printf ("#undef _RWSTD_OS_VERSION\n");
+    printf ("#undef _RWSTD_OS_MICRO\n");
+
 #endif

     return 0;

Mime
View raw message