X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fguile-init.cc;h=86a998e9ab5c71ab23fda0465067c33650ebf8b8;hb=04c5cece95672044388052de186b21674f4bb0dc;hp=98b779efaa3d2a1afe2a95a76963aa127ca5e64d;hpb=e7aa6c445f463844dbaa52d38ea4aac2882b5601;p=lilypond.git diff --git a/lily/guile-init.cc b/lily/guile-init.cc index 98b779efaa..86a998e9ab 100644 --- a/lily/guile-init.cc +++ b/lily/guile-init.cc @@ -1,7 +1,7 @@ /* This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 2006--2014 Han-Wen Nienhuys + Copyright (C) 2006--2015 Han-Wen Nienhuys LilyPond is free software: you can redistribute it and/or modify @@ -21,11 +21,21 @@ #include "lily-guile.hh" #include "main.hh" #include "warn.hh" +#include "smobs.hh" /* INIT */ +// Why a pointer here? Because it has zero initialization at load +// time which is guaranteed to come before the static initializations +// of all constructors for static expressions of the classes created +// by ADD_SCM_INIT_FUNC. The vector data type does not have load-time +// initialization and might clear out already set callbacks at the +// time it is initialized since there is no implied order among +// non-trivial constructors for static data in separate compilation +// units. So we need a trivial type like a pointer instead. + typedef void (*Void_fptr) (); vector *scm_init_funcs_; @@ -40,6 +50,8 @@ void add_scm_init_func (void (*f) ()) void ly_init_ly_module (void *) { + // Start up type system first. + Scm_init::init (); for (vsize i = scm_init_funcs_->size (); i--;) (scm_init_funcs_->at (i)) (); @@ -51,7 +63,7 @@ ly_init_ly_module (void *) debug_output ("]\n", false); } - scm_primitive_load_path (scm_from_locale_string ("lily.scm")); + scm_primitive_load_path (scm_from_ascii_string ("lily.scm")); } SCM global_lily_module;