rivo / uniseg

Unicode Text Segmentation, Word Wrapping, and String Width Calculation in Go
MIT License
570 stars 60 forks source link

Error building using gcc go 1.13.1 #33

Closed micwoj92 closed 1 year ago

micwoj92 commented 1 year ago

c29cfd277c87e6115f89ba29f0f7b0544b2bfd68 go version go1.18 gccgo (GCC) 13.1.1 20230429 linux/amd64

go build
# github.com/rivo/uniseg
./properties.go:137:20: error: expected ‘(’
  137 | func propertySearch[E interface{ [3]int | [4]int }](dictionary []E, r rune) (result E) {
      |                    ^
./properties.go:137:23: error: expected ‘]’
  137 | func propertySearch[E interface{ [3]int | [4]int }](dictionary []E, r rune) (result E) {
      |                       ^
./properties.go:137:23: error: expected ‘;’ or newline after top level declaration
./properties.go:140:9: error: expected declaration
  140 |         to := len(dictionary)
      |         ^
./properties.go:141:9: error: expected declaration
  141 |         for to > from {
      |         ^
./properties.go:143:17: error: expected declaration
  143 |                 cpRange := dictionary[middle]
      |                 ^
./properties.go:144:17: error: expected declaration
  144 |                 if int(r) < cpRange[0] {
      |                 ^
./properties.go:146:25: error: expected declaration
  146 |                         continue
      |                         ^
./properties.go:147:17: error: expected declaration
  147 |                 }
      |                 ^
./properties.go:148:17: error: expected declaration
  148 |                 if int(r) > cpRange[1] {
      |                 ^
./properties.go:150:25: error: expected declaration
  150 |                         continue
      |                         ^
./properties.go:151:17: error: expected declaration
  151 |                 }
      |                 ^
./properties.go:152:17: error: expected declaration
  152 |                 return cpRange
      |                 ^
./properties.go:153:9: error: expected declaration
  153 |         }
      |         ^
./properties.go:154:9: error: expected declaration
  154 |         return
      |         ^
./properties.go:155:1: error: expected declaration
  155 | }
      | ^
rivo commented 1 year ago

See here: https://go.dev/doc/install/gccgo

The GCC 12 and 13 releases include a complete implementation of the Go 1.18 standard library. However, GCC does not yet include support for generics.

Please use the regular Go compiler. Or you might have to wait until gccgo supports generics.