go-type-error.c 813 B

1234567891011121314151617181920212223242526272829
  1. /* go-type-error.c -- invalid hash and equality functions.
  2. Copyright 2009 The Go Authors. All rights reserved.
  3. Use of this source code is governed by a BSD-style
  4. license that can be found in the LICENSE file. */
  5. #include "runtime.h"
  6. #include "go-type.h"
  7. /* A hash function used for a type which does not support hash
  8. functions. */
  9. uintptr_t
  10. __go_type_hash_error (const void *val __attribute__ ((unused)),
  11. uintptr_t key_size __attribute__ ((unused)))
  12. {
  13. runtime_panicstring ("hash of unhashable type");
  14. }
  15. /* An equality function for an interface. */
  16. _Bool
  17. __go_type_equal_error (const void *v1 __attribute__ ((unused)),
  18. const void *v2 __attribute__ ((unused)),
  19. uintptr_t key_size __attribute__ ((unused)))
  20. {
  21. runtime_panicstring ("comparing uncomparable types");
  22. }