comparison runtime/proghead.inc @ 182:ab7c142090a0

Make method names available at runtime so they can be included in method not implemented error messages
author Mike Pavone <pavone@retrodev.com>
date Sat, 24 Aug 2013 19:02:59 -0700
parents abc6f3d644a4
children 632667d95d35
comparison
equal deleted inserted replaced
181:f188723c15b4 182:ab7c142090a0
4 #include <stdio.h> 4 #include <stdio.h>
5 #include <gc/gc.h> 5 #include <gc/gc.h>
6 6
7 object * main_module; 7 object * main_module;
8 8
9 char * methodNames[];
10
9 object * no_impl(uint32_t method_id, uint32_t num_args, object * self, va_list args) 11 object * no_impl(uint32_t method_id, uint32_t num_args, object * self, va_list args)
10 { 12 {
11 fprintf(stderr, "method %d is not implemented on object %p\n", method_id, self); 13 fprintf(stderr, "method %s(%d) is not implemented on object %p\n", methodNames[method_id], method_id, self);
12 fprintf(stderr, "main_module %p\n", main_module); 14 fprintf(stderr, "main_module %p\n", main_module);
13 exit(1); 15 exit(1);
14 return NULL; 16 return NULL;
15 } 17 }
16 18