Changeset 4695:0e099bec8251 in roaraudio


Ignore:
Timestamp:
12/28/10 22:02:32 (11 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

some code to use GetVersionEx?()...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roard/req.c

    r4652 r4695  
    579579 struct utsname utsname; 
    580580#endif 
     581#ifdef ROAR_HAVE_GETVERSIONEX 
     582 OSVERSIONINFO osinfo; 
     583 char buf_release[80]; 
     584#endif 
    581585 struct roar_server_info info; 
    582586 uint16_t * d16; 
     
    614618    info.un.nodename = utsname.nodename; 
    615619    info.un.machine  = utsname.machine; 
     620   } 
     621#endif 
     622#ifdef ROAR_HAVE_GETVERSIONEX 
     623   osinfo.dwOSVersionInfoSize = sizeof(osinfo); 
     624   if ( GetVersionEx(&osinfo) ) { 
     625    info.un.sysname = "Windows"; 
     626    snprintf(buf_release, sizeof(buf_release), "%i.%i.%i", 
     627               osinfo.dwMajorVersion, osinfo.dwMinorVersion, osinfo.dwBuildNumber); 
     628    buf_release[sizeof(buf_release)-1] = 0; 
     629    info.un.release = buf_release; 
    616630   } 
    617631#endif 
Note: See TracChangeset for help on using the changeset viewer.