Re: WEE under Wine
- Posted by ghaberek (admin) Feb 04, 2015
- 1456 views
Here is an example based on the code in that link. I have not properly tested because I do not have Wine installed. On Windows I get "did not detect Wine" as expected.
include std/dll.e include std/machine.e public function wine_get_version() object version = 0 ifdef WINDOWS then atom ntdll = open_dll( "ntdll.dll" ) integer _wine_get_version = define_c_func( ntdll, "+wine_get_version", {}, C_POINTER ) if _wine_get_version != -1 then atom pversion = c_func( _wine_get_version, {} ) version = peek_string( pversion ) end if end ifdef return version end function object version = wine_get_version() if sequence( version ) then printf( 1, "running on Wine %s\n", {version} ) else puts( 1, "did not detect Wine\n" ) end if
-Greg