summaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
authorruki <[email protected]>2016-08-03 13:55:04 +0800
committerruki <[email protected]>2016-08-03 13:55:04 +0800
commiteefd50df43ff0648e303194ff8378cd664381bff (patch)
treedb04fa1c6e0ae710f9e059601d2d868f6b61579d /core/src
parent4c34e6a5200687a543d3eeeedb6b403887f5b1a1 (diff)
impl os.uuid and update tbox for macosx and windows
Diffstat (limited to 'core/src')
-rwxr-xr-xcore/src/xmake/os/uuid.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/src/xmake/os/uuid.c b/core/src/xmake/os/uuid.c
index c30d52815..73faa383c 100755
--- a/core/src/xmake/os/uuid.c
+++ b/core/src/xmake/os/uuid.c
@@ -41,9 +41,11 @@ tb_int_t xm_os_uuid(lua_State* lua)
tb_assert_and_check_return_val(lua, 0);
// get the name
- tb_char_t const* name = luaL_checkstring(lua, 1);
- tb_used(name);
+ tb_char_t const* name = luaL_optstring(lua, 1, tb_null);
+ // make uuid
+ tb_char_t uuid[37];
+ lua_pushstring(lua, tb_uuid_make_cstr(uuid, name));
// ok
return 1;