Helper: register a free function
| 52 | |
| 53 | // Helper: register a free function |
| 54 | static void reg_func(CBMTypeRegistry* reg, CBMArena* arena, |
| 55 | const char* qn, const char* short_name, const CBMType* ret_type) { |
| 56 | CBMRegisteredFunc rf; |
| 57 | memset(&rf, 0, sizeof(rf)); |
| 58 | rf.min_params = -1; |
| 59 | rf.qualified_name = qn; |
| 60 | rf.short_name = short_name; |
| 61 | rf.signature = cbm_type_func(arena, NULL, NULL, |
| 62 | ret_type ? (const CBMType*[]){ret_type, NULL} : NULL); |
| 63 | cbm_registry_add_func(reg, rf); |
| 64 | } |
| 65 | |
| 66 | void cbm_cpp_stdlib_register(CBMTypeRegistry* reg, CBMArena* arena) { |
| 67 | const CBMType* t_void = cbm_type_builtin(arena, "void"); |
no test coverage detected