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