]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/guile-init.cc
Run scripts/auxiliar/update-with-convert-ly.sh
[lilypond.git] / lily / guile-init.cc
index be07a56106e96659daa25b2a64666f5725141eaf..86a998e9ab5c71ab23fda0465067c33650ebf8b8 100644 (file)
@@ -1,8 +1,8 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 2006--2009 Han-Wen Nienhuys <hanwen@lilypond.org>
-  
+  Copyright (C) 2006--2015 Han-Wen Nienhuys <hanwen@lilypond.org>
+
 
   LilyPond is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#include  "lily-guile.hh"
-#include  "main.hh"
-#include  "warn.hh"
+#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<Void_fptr> *scm_init_funcs_;
@@ -41,18 +50,20 @@ 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)) ();
 
-  if (be_verbose_global)
+  if (is_loglevel (LOG_DEBUG))
     {
-      progress_indication ("[");
+      debug_output ("[", true);
       scm_display (scm_c_eval_string ("(%search-load-path \"lily.scm\")"),
-                  scm_current_error_port ());
-      progress_indication ("]\n");
+                   scm_current_error_port ());
+      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;