ccm_stub_darwin.go 662 B

1234567891011121314151617181920
  1. //go:build with_ccm && darwin && !cgo
  2. package include
  3. import (
  4. "context"
  5. "github.com/sagernet/sing-box/adapter"
  6. "github.com/sagernet/sing-box/adapter/service"
  7. C "github.com/sagernet/sing-box/constant"
  8. "github.com/sagernet/sing-box/log"
  9. "github.com/sagernet/sing-box/option"
  10. E "github.com/sagernet/sing/common/exceptions"
  11. )
  12. func registerCCMService(registry *service.Registry) {
  13. service.Register[option.CCMServiceOptions](registry, C.TypeCCM, func(ctx context.Context, logger log.ContextLogger, tag string, options option.CCMServiceOptions) (adapter.Service, error) {
  14. return nil, E.New(`CCM requires CGO on darwin, rebuild with CGO_ENABLED=1`)
  15. })
  16. }