setjmp/trycatch

This commit is contained in:
xushiwei
2024-06-08 00:08:29 +08:00
parent d4249da131
commit fcf3f2abc7
8 changed files with 16 additions and 13 deletions

View File

@@ -2,7 +2,7 @@ package main
import (
"github.com/goplus/llgo/c/setjmp"
"github.com/goplus/llgo/c/setjmp/demo"
"github.com/goplus/llgo/c/setjmp/trycatch"
)
func main() {
@@ -10,7 +10,7 @@ func main() {
switch ret := setjmp.Sigsetjmp(&jb, 0); ret {
case 0:
println("Hello, setjmp!")
demo.ThrowCppException()
trycatch.ThrowCppException()
setjmp.Siglongjmp(&jb, 1)
default:
println("exception:", ret)