sys.go 417 B

12345678910111213141516171819202122
  1. // Copyright 2017 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. //go:build solaris
  5. // +build solaris
  6. package lif
  7. import "unsafe"
  8. var nativeEndian binaryByteOrder
  9. func init() {
  10. i := uint32(1)
  11. b := (*[4]byte)(unsafe.Pointer(&i))
  12. if b[0] == 1 {
  13. nativeEndian = littleEndian
  14. } else {
  15. nativeEndian = bigEndian
  16. }
  17. }