gtsocial-umbx

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

platform.go (405B)


      1 package link
      2 
      3 import (
      4 	"fmt"
      5 	"runtime"
      6 )
      7 
      8 func platformPrefix(symbol string) string {
      9 
     10 	prefix := runtime.GOARCH
     11 
     12 	// per https://github.com/golang/go/blob/master/src/go/build/syslist.go
     13 	switch prefix {
     14 	case "386":
     15 		prefix = "ia32"
     16 	case "amd64", "amd64p32":
     17 		prefix = "x64"
     18 	case "arm64", "arm64be":
     19 		prefix = "arm64"
     20 	default:
     21 		return symbol
     22 	}
     23 
     24 	return fmt.Sprintf("__%s_%s", prefix, symbol)
     25 }