Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
added some code for directory stuff on windows
  • Loading branch information
thenumbernine committed Jun 10, 2019
1 parent bb5c1dc commit ad40930
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 19 additions & 0 deletions c/unistd.lua
Expand Up @@ -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
2 changes: 1 addition & 1 deletion imgui.lua
Expand Up @@ -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,
Expand Down

0 comments on commit ad40930

Please sign in to comment.