diff --git a/c/unistd.lua b/c/unistd.lua index dda159f..af43730 100644 --- a/c/unistd.lua +++ b/c/unistd.lua @@ -5,4 +5,23 @@ ffi.cdef[[ int chdir(const char* path); extern char* getcwd(char* buf, size_t size); +// in Windows in direct.h: +int _chdir(const char* path); +extern char* _getcwd(char* buf, size_t size); + ]] + +-- I can't change ffi.C.getcwd to ffi.C._getcwd in the case of Windows +-- but I can at least return a table that changes names depending on the OS: + +if ffi.os == 'Windows' then + return { + chdir = ffi.C._chdir, + getcwd = ffi.C._getcwd, + } +else + return { + chdir = ffi.C.chdir, + getcwd = ffi.C.getcwd, + } +end diff --git a/imgui.lua b/imgui.lua index d451097..c41e82c 100644 --- a/imgui.lua +++ b/imgui.lua @@ -115,7 +115,7 @@ local wrapper = setmetatable({ local label, v, step, step_fast, decimal_precision, extra_flags = ... if n < 3 then step = 0 end if n < 4 then step_fast = 0 end - if n < 5 then decimal_precision = -1 end + if n < 5 then decimal_precision = '%3f' end if n < 6 then extra_flags = 0 end return ig.igInputFloat(label, v, step, step_fast, decimal_precision, extra_flags) end,