summaryrefslogtreecommitdiff
path: root/src/mingw_functions.c
diff options
context:
space:
mode:
authorBryan Ischo <bryan@ischo.com>2008-08-08 10:39:05 +0000
committerBryan Ischo <bryan@ischo.com>2008-08-08 10:39:05 +0000
commit65bf04902ec7a6e47e9564c63518c2d29875b35f (patch)
treebf0bb373e4123b837df9d05c1d42b99731bcb791 /src/mingw_functions.c
parentcec9b06bc4fee869da98ed284a9fa1b6e3352a4f (diff)
downloadceph-libs3-65bf04902ec7a6e47e9564c63518c2d29875b35f.tar.gz
* Fixed a bunch of Windows build stuff
* Added a Windows "install" target * Changed trunk version number to "trunk.trunk"
Diffstat (limited to 'src/mingw_functions.c')
-rw-r--r--src/mingw_functions.c55
1 files changed, 43 insertions, 12 deletions
diff --git a/src/mingw_functions.c b/src/mingw_functions.c
index 6cdd296..cebad07 100644
--- a/src/mingw_functions.c
+++ b/src/mingw_functions.c
@@ -28,20 +28,51 @@
int uname(struct utsname *u)
{
- u->sysname = "not implemented";
- u->machine = "not implemented";
+ OSVERSIONINFO info;
+ info.dwOSVersionInfoSize = sizeof(info);
- return 0;
-}
+ if (!GetVersionEx(&info)) {
+ return -1;
+ }
-int setenv(const char *a, const char *b, int c)
-{
- return 0;
-}
+ u->machine = "";
-int unsetenv(const char *a)
-{
- return 0;
-}
+ switch (info.dwMajorVersion) {
+ case 4:
+ switch (info.dwMinorVersion) {
+ case 0:
+ u->sysname = "Microsoft Windows NT 4.0";
+ break;
+ case 10:
+ u->sysname = "Microsoft Windows 98";
+ break;
+ case 90:
+ u->sysname = "Microsoft Windows Me";
+ break;
+ default:
+ return -1;
+ }
+ break;
+
+ case 5:
+ switch (info.dwMinorVersion) {
+ case 0:
+ u->sysname = "Microsoft Windows 2000";
+ break;
+ case 1:
+ u->sysname = "Microsoft Windows XP";
+ break;
+ case 2:
+ u->sysname = "Microsoft Server 2003";
+ break;
+ default:
+ return -1;
+ }
+ break;
+ default:
+ return -1;
+ }
+ return 0;
+}