[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Compilation fixes for GUILE 2.2 (issue 571430046 by address@hidden)
From: |
hanwenn |
Subject: |
Re: Compilation fixes for GUILE 2.2 (issue 571430046 by address@hidden) |
Date: |
Sun, 26 Jan 2020 06:18:20 -0800 |
Reviewers: hahnjo,
https://codereview.appspot.com/571430046/diff/551390052/lily/main.cc
File lily/main.cc (right):
https://codereview.appspot.com/571430046/diff/551390052/lily/main.cc#newcode830
lily/main.cc:830: catch (std::exception e)
On 2020/01/26 14:13:58, hahnjo wrote:
> Is it really throwing C++ exceptions? If this means to catch any from
LilyPond,
> I don't think we throw any and I have a patch locally which compiles
all of
> LilyPond with -fno-exceptions to reduce binary size.
I think the C++ library might throw exceptions if you're unlucky.
I prefer we discuss getting rid of this code some other time. I just
want it to compile.
Description:
Compilation fixes for GUILE 2.2
* programming_error is void, which cannot be returned
* only define and call setup_guile_v2_env for GUILEV2
* Prefix exception with std::
Please review this at https://codereview.appspot.com/571430046/
Affected files (+7, -5 lines):
M lily/general-scheme.cc
M lily/main.cc
Index: lily/general-scheme.cc
diff --git a/lily/general-scheme.cc b/lily/general-scheme.cc
index
629c85ccaa7483d542d16d54e548279d2a401483..d2f3fbdf8b17fd352ee1dfdee763f5bb88f26f00
100644
--- a/lily/general-scheme.cc
+++ b/lily/general-scheme.cc
@@ -277,7 +277,8 @@ LY_DEFINE (ly_protects, "ly:protects",
#if SCM_MAJOR_VERSION < 2 || SCM_MAJOR_VERSION == 2 && SCM_MINOR_VERSION < 1
return scm_protects;
#else
- return programming_error ("ly:protects is not supported in Guile 2.1");
+ programming_error ("ly:protects is not supported in Guile 2.1");
+ return SCM_EOL;
#endif
}
Index: lily/main.cc
diff --git a/lily/main.cc b/lily/main.cc
index
205dd56b5b7ee79eed3868e96b8a96d490599b14..b23c1596e7b3d1d0247e5a6664fae1bca4e48b53
100644
--- a/lily/main.cc
+++ b/lily/main.cc
@@ -747,7 +747,7 @@ setup_guile_gc_env ()
"104857600", overwrite);
}
-
+#if (GUILEV2)
void
setup_guile_v2_env ()
/*
@@ -765,6 +765,7 @@ setup_guile_v2_env ()
sane_putenv("XDG_CACHE_HOME",
lilypond_datadir, true);
}
+#endif
void
setup_guile_env ()
@@ -772,10 +773,10 @@ setup_guile_env ()
* Set up environment variables relevant to Scheme
*/
{
-
- setup_guile_gc_env (); // configure garbage collector
#if (GUILEV2)
setup_guile_v2_env (); // configure Guile V2 behaviour
+#else
+ setup_guile_gc_env (); // configure garbage collector
#endif
}
@@ -826,7 +827,7 @@ main (int argc, char **argv, char **envp)
{
scm_boot_guile (argc, argv, main_with_guile, 0);
}
- catch (exception e)
+ catch (std::exception e)
{
error (_f ("exception caught: %s", e.what ()));
};