From 4385ca0966ec4f8264f36671537e2080fd6bf04d Mon Sep 17 00:00:00 2001 From: xushiwei Date: Tue, 25 Jun 2024 14:02:25 +0800 Subject: [PATCH] patch: internal/abi --- cl/import.go | 3 ++- internal/build/build.go | 1 + internal/lib/internal/abi/abi.go | 26 ++++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 internal/lib/internal/abi/abi.go diff --git a/cl/import.go b/cl/import.go index b9baec86..6703981d 100644 --- a/cl/import.go +++ b/cl/import.go @@ -527,7 +527,8 @@ func ignoreName(name string) bool { } func supportedInternal(name string) bool { - return strings.HasPrefix(name, "bytealg.") || strings.HasPrefix(name, "reflectlite.") + return strings.HasPrefix(name, "abi.") || strings.HasPrefix(name, "bytealg.") || + strings.HasPrefix(name, "reflectlite.") } // ----------------------------------------------------------------------------- diff --git a/internal/build/build.go b/internal/build/build.go index de0b52c0..91bdb9f0 100644 --- a/internal/build/build.go +++ b/internal/build/build.go @@ -730,6 +730,7 @@ type none struct{} var hasAltPkg = map[string]none{ "errors": {}, + "internal/abi": {}, "internal/bytealg": {}, "internal/reflectlite": {}, "io": {}, diff --git a/internal/lib/internal/abi/abi.go b/internal/lib/internal/abi/abi.go new file mode 100644 index 00000000..a945995d --- /dev/null +++ b/internal/lib/internal/abi/abi.go @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2024 The GoPlus Authors (goplus.org). All rights reserved. + * + * 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. + */ + +package abi + +// llgo:skipall +import ( + _ "unsafe" + + "github.com/goplus/llgo/internal/abi" +) + +type InterfaceType = abi.InterfaceType