1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-07-02 23:50:47 +02:00

Locale have static tc16

* libguile/print.c (iprin1):
* libguile/eq.c (scm_equal_p): Add case for locales and also regexps
which we missed in the past.
* libguile/finalizers.h:
* libguile/finalizers.c (scm_i_add_locale_finalizer):
(run_finalizer): Add locale finalizers.
* libguile/scm.h (scm_tc16_locale): New tc16.
* module/oop/goops.scm:
* libguile/goops.c: Add locale class.
* libguile/i18n.c: Give locale objects their own tc16.
This commit is contained in:
Andy Wingo 2025-06-18 12:18:24 +02:00
parent a5c70aa914
commit bc43d4f9a7
9 changed files with 84 additions and 25 deletions

View file

@ -145,6 +145,7 @@ static SCM class_directory;
static SCM class_macro;
static SCM class_random_state;
static SCM class_regexp;
static SCM class_locale;
static struct scm_ephemeron_table *vtable_class_map;
static SCM pre_goops_vtables = SCM_EOL;
@ -360,6 +361,8 @@ SCM_DEFINE (scm_class_of, "class-of", 1, 0, 0,
return class_random_state;
case scm_tc16_regexp:
return class_regexp;
case scm_tc16_locale:
return class_locale;
default:
abort ();
}
@ -1002,6 +1005,7 @@ SCM_DEFINE (scm_sys_goops_early_init, "%goops-early-init", 0, 0, 0,
class_macro = scm_variable_ref (scm_c_lookup ("<macro>"));
class_random_state = scm_variable_ref (scm_c_lookup ("<random-state>"));
class_regexp = scm_variable_ref (scm_c_lookup ("<regexp>"));
class_locale = scm_variable_ref (scm_c_lookup ("<locale>"));
create_smob_classes ();
create_struct_classes ();