mirror of
https://github.com/janet-lang/janet
synced 2024-12-01 04:19:55 +00:00
Remove exit in favor of os-exit.
This commit is contained in:
parent
e21a69920f
commit
0d5b57daee
@ -56,7 +56,6 @@ static const DstReg cfuns[] = {
|
|||||||
{"next", dst_core_next},
|
{"next", dst_core_next},
|
||||||
{"hash", dst_core_hash},
|
{"hash", dst_core_hash},
|
||||||
{"string-slice", dst_core_string_slice},
|
{"string-slice", dst_core_string_slice},
|
||||||
{"exit", dst_core_exit},
|
|
||||||
{NULL, NULL}
|
{NULL, NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -23,15 +23,6 @@
|
|||||||
#include <dst/dst.h>
|
#include <dst/dst.h>
|
||||||
#include <dst/dstcorelib.h>
|
#include <dst/dstcorelib.h>
|
||||||
|
|
||||||
int dst_core_exit(DstArgs args) {
|
|
||||||
int32_t exitcode = 0;
|
|
||||||
if (args.n > 0) {
|
|
||||||
exitcode = dst_hash(args.v[0]);
|
|
||||||
}
|
|
||||||
exit(exitcode);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int dst_core_print(DstArgs args) {
|
int dst_core_print(DstArgs args) {
|
||||||
int32_t i;
|
int32_t i;
|
||||||
for (i = 0; i < args.n; ++i) {
|
for (i = 0; i < args.n; ++i) {
|
||||||
|
@ -77,7 +77,6 @@ int dst_ceil(DstArgs args);
|
|||||||
int dst_pow(DstArgs args);
|
int dst_pow(DstArgs args);
|
||||||
|
|
||||||
/* Misc core functions */
|
/* Misc core functions */
|
||||||
int dst_core_exit(DstArgs args);
|
|
||||||
int dst_core_print(DstArgs args);
|
int dst_core_print(DstArgs args);
|
||||||
int dst_core_describe(DstArgs args);
|
int dst_core_describe(DstArgs args);
|
||||||
int dst_core_string(DstArgs args);
|
int dst_core_string(DstArgs args);
|
||||||
|
@ -11,8 +11,8 @@
|
|||||||
(print " -h Show this help")
|
(print " -h Show this help")
|
||||||
(print " -v Print the version string")
|
(print " -v Print the version string")
|
||||||
(print " -r Enter the repl after running all scripts")
|
(print " -r Enter the repl after running all scripts")
|
||||||
(exit 0))
|
(os-exit 0))
|
||||||
"v" (fn [] (print VERSION) (exit 0))
|
"v" (fn [] (print VERSION) (os-exit 0))
|
||||||
"r" (fn [] (:= *should-repl* true))
|
"r" (fn [] (:= *should-repl* true))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -19,5 +19,4 @@
|
|||||||
(defn end-suite []
|
(defn end-suite []
|
||||||
(print "\nTest suite " suite-num " finished.")
|
(print "\nTest suite " suite-num " finished.")
|
||||||
(print num-tests-passed " of " num-tests-run " tests passed.\n")
|
(print num-tests-passed " of " num-tests-run " tests passed.\n")
|
||||||
(if (not= num-tests-passed num-tests-run) (exit 1)))
|
(if (not= num-tests-passed num-tests-run) (os-exit 1)))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user