sys.go 398 B

123456789101112131415161718192021
  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. // +build solaris
  5. package lif
  6. import "unsafe"
  7. var nativeEndian binaryByteOrder
  8. func init() {
  9. i := uint32(1)
  10. b := (*[4]byte)(unsafe.Pointer(&i))
  11. if b[0] == 1 {
  12. nativeEndian = littleEndian
  13. } else {
  14. nativeEndian = bigEndian
  15. }
  16. }