Re: Euphoria 4.1 problem - as relates to tinewg
- Posted by jmduro May 01, 2016
- 3473 views
Something could be derivated from my Structures Management library to resolve this problem.
Example for C_LONG
public function allocate_C_LONG(atom p) integer lg ifdef EU4_0 then lg = 4 elsifdef EU4_1 then ifdef BITS32 then -- 32-bit lg = 4 elsifdef BITS64 then -- 64-bit lg = 8 end ifdef end ifdef p = allocate(lg) return p end function ----------------------------------------------------------------------------- public procedure write_C_LONG(atom p, atom value) -- printf(f_debug, "writeStructure(%d, %s, %s)\n", {p, sprint(def), sprint(values)}) ifdef EU4_0 then putInt32(p, value) elsifdef EU4_1 then ifdef BITS32 then -- 32-bit putInt32(p, value) elsifdef BITS64 then -- 64-bit putInt64(p, value) end ifdef end ifdef end procedure ----------------------------------------------------------------------------- public function read_C_LONG(atom p) sequence result = {} ifdef EU4_0 then result = getSInt32(p) elsifdef EU4_1 then ifdef BITS32 then -- 32-bit result = getSInt32(p) elsifdef BITS64 then -- 64-bit result = getSInt64(p) end ifdef end ifdef return result end function
Jean-Marc