[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: lilly_libcxx.patch for building against libc++
From: |
Jack Howarth |
Subject: |
Re: lilly_libcxx.patch for building against libc++ |
Date: |
Fri, 15 Nov 2013 13:44:56 -0500 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
On Thu, Nov 14, 2013 at 09:55:33PM +0100, David Kastrup wrote:
> Jack Howarth <address@hidden> writes:
>
> > The attached patch, lilly_libcxx.patch, contains the changes which allow
> > lilypond 2.17.95
> > to build against libc++ on Xcode 10.9 with the clang++ compiler. There is a
> > glitch in the
> > configure/makefiles currently that requires that the user pass
> > -DHAVE_STL_DATA_METHOD on
> > CXXFLAGS. The problem is odd as configure seems able to set...
> >
> > /* define if you have stl data () method */
> > #define HAVE_STL_DATA_METHOD 1
> >
> > in the top level config.hh but it doesn't seem to get passed down to
> > flowers/include/std-vector.hh
> > when included in file-path.cc.
>
> See <URL:http://code.google.com/p/lilypond/issues/detail?id=3656>
>
> Can you explain what the problem with to_string is actually about? Can
> we fix this in a way that does not require explicit scoping?
David,
Looking at the suggestions in...
http://stackoverflow.com/questions/9150538/how-do-i-tostring-an-enum-in-c
it would appear that Lilypond should be using static maps to solve this. The
following
changes to the previously posted arpeggio.ii testcase solves the compilation
failure
under clang++ and libc++ on 10.9...
--- arpeggio.ii.orig 2013-11-15 13:27:16.000000000 -0500
+++ arpeggio.ii 2013-11-15 13:35:27.000000000 -0500
@@ -28701,6 +28701,8 @@
DIRECTION_NEG_LIMIT = -2,
};
+std::string DirectionMap [] = { "UP", "DOWN", "LEFT", "RIGHT", "MIN", "MAX",
"CENTER", "SMALLER", "BIGGER", "START", "STOP", "DIRECTION_LIMIT",
"DIRECTION_NEG_LIMIT"};
+
inline Direction
other_dir (Direction const d)
{
@@ -41895,7 +41897,7 @@
if (dir)
{
Font_metric *fm = Font_interface::get_default_font (me);
- arrow = fm->find_by_name ("scripts.arpeggio.arrow." + to_string (dir));
+ arrow = fm->find_by_name ("scripts.arpeggio.arrow." + DirectionMap[dir]);
heads[dir] -= dir * arrow.extent (Y_AXIS).length ();
}
Jack
>
> --
> David Kastrup