Re: eugtk history
- Posted by andi49 Aug 22, 2015
- 2481 views
This fix works for me, EXCEPT, I'm getting a console window popping up with this message:
FIXME Windows GtkEngine.e line 146...151
What is that?
constant os_info = os:uname() localhost = "127.0.0.1", ifdef UNIX then export constant os_architecture = os_info[5], -- e.g: x86_64 os_shell = getenv("SHELL"), -- e.g: /bin/bash host_addr = inet_address() end ifdef ifdef WINDOWS then -- FIXME display("FIXME Windows GtkEngine.e line 146..151") -- *** here be that message! *** export constant os_architecture = "unknown", os_shell = "cmd.com", host_addr = localhost end ifdef object os_term = getenv("TERM") if atom(os_term) then os_term = "none" end if ifdef WINDOWS then os_term = "CMD.COM" end ifdef
Clearly a few of those values are untested on windows.
I have Euphoria code that identifies the Windows OS for another program I use. Do I need to plug it in here to fix this? Seems like that's what this needs, eh?
Thanks for the heads up, Pete!
Actually, Euphoria needs to know what OS it's running on. Doesn't it know that already?!?!
Hi
Something like this, it's only for 32bit and not really tested.
include std/net/dns.e include std/console.e include std/dll.e include std/machine.e -- PROCESSOR_ARCHITECTURE_AMD64=9 -- PROCESSOR_ARCHITECTURE_ARM=5 -- PROCESSOR_ARCHITECTURE_IA64=6 -- PROCESSOR_ARCHITECTURE_INTEL=0 -- PROCESSOR_ARCHITECTURE_UNKNOWN=0xffff sequence addr constant kernel=open_dll("kernel32.dll") constant GetSystemInfo=define_c_proc(kernel,"GetSystemInfo",{C_POINTER}) function GetArch() sequence arch="Unknown" atom SYSTEM_INFO=allocate(36) c_proc(GetSystemInfo,{SYSTEM_INFO}) if equal(peek2u(SYSTEM_INFO),0) then arch="x86" elsif equal(peek2u(SYSTEM_INFO),9) then arch="AMD64" end if free(SYSTEM_INFO) return arch end function function GetShell() return getenv("COMSPEC") end function function GetLocalIp() addr=host_by_addr("127.0.0.1") addr=host_by_name(addr[1]) return(addr[3][1]) end function puts(1,GetArch()&"\n") puts(1,GetShell()&"\n") puts(1,GetLocalIp()&"\n") any_key()
Andreas
[EDIT]
After thinking about the above code i decided that GetArch() can be simply replaced by this code:
function GetArch() sequence arch ifdef BITS64 then arch="AMD64" elsedef arch="x86" end ifdef return arch end function
Architecture IA64 and ARM are not supported by Euphoria, also i do not see a need for 'Unknown'.
A 64bit program simply does not work on 32bit, so if the program works it has to be AMD64.
A 32bit program does not need to know if it is working on a 64bit host, it lives in 32bit world with 32bit dll's etc.
And so the function allways return x86 for this program.
(Maybe, a Setup Program (that is used to install both 32bit and 64bit versions) written as a 32bit Program needs to know the host architecture)
Andreas