c/setjmp/demo

This commit is contained in:
xushiwei
2024-06-07 14:12:35 +08:00
parent 4868903844
commit 95c1886df5
6 changed files with 115 additions and 0 deletions

View File

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