cgo1.go 337 B

12345678910111213141516171819202122
  1. // Copyright 2012 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. package rand
  5. /*
  6. #include <stdlib.h>
  7. */
  8. import "C"
  9. // STOP OMIT
  10. func Random() int {
  11. return int(C.rand())
  12. }
  13. // STOP OMIT
  14. func Seed(i int) {
  15. C.srand(C.uint(i))
  16. }
  17. // END OMIT