summaryrefslogtreecommitdiff
path: root/core/src/xmake/os
diff options
context:
space:
mode:
authorruki <[email protected]>2020-02-21 22:53:05 +0800
committerruki <[email protected]>2020-02-21 11:18:31 +0800
commit2ce8c14ab4cee3a5673aa24649196cb45dcc0426 (patch)
tree295eaa446ccec43eab5e820c4193bfe1cc5d1ee7 /core/src/xmake/os
parent868450acbb14b1bf5cd2da7b1b09a195e88a6bd5 (diff)
add os.syserror
Diffstat (limited to 'core/src/xmake/os')
-rw-r--r--core/src/xmake/os/syserror.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/core/src/xmake/os/syserror.c b/core/src/xmake/os/syserror.c
new file mode 100644
index 000000000..9630bd3c8
--- /dev/null
+++ b/core/src/xmake/os/syserror.c
@@ -0,0 +1,45 @@
+/*!A cross-platform build utility based on Lua
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Copyright (C) 2015-2020, TBOOX Open Source Group.
+ *
+ * @author ruki
+ * @file syserror.c
+ *
+ */
+
+/* //////////////////////////////////////////////////////////////////////////////////////
+ * trace
+ */
+#define TB_TRACE_MODULE_NAME "syserror"
+#define TB_TRACE_MODULE_DEBUG (0)
+
+/* //////////////////////////////////////////////////////////////////////////////////////
+ * includes
+ */
+#include "prefix.h"
+
+/* //////////////////////////////////////////////////////////////////////////////////////
+ * implementation
+ */
+tb_int_t xm_os_syserror(lua_State* lua)
+{
+ // check
+ tb_assert_and_check_return_val(lua, 0);
+
+ // get syserror state
+ tb_size_t syserror = tb_syserror_state();
+ lua_pushinteger(lua, (tb_int_t)syserror);
+ return 1;
+}