On Sun, Mar 28, 2010 at 10:12 AM, Patrick McCarty <pnor...@gmail.com> wrote:
> On 2010-03-28, Carl Sorensen wrote:
>>
>> Perhaps we have different versions of gcc.  I'm using the following:
>>
>> sorensen2:~ Carl$ gcc --version
>> i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5493)
>
> Yes, we do have different versions of gcc.  Here's mine:
>
> $ gcc --version
> gcc (GCC) 4.4.3
>
> I can see the motivation behind Han-Wen's commit, so I'll see if I can
> track this problem down.

I'm still in foreign territory here, but I have a possible solution
for your problem.  Can you test the attached patch instead of the one
I send to you earlier?

I just posted a patch to Rietveld as well:
http://codereview.appspot.com/819041/show

Thanks,
Patrick
From 5f0cb9f36b091f206d0903a8ab840b429c37515c Mon Sep 17 00:00:00 2001
From: Patrick McCarty <pnor...@gmail.com>
Date: Sun, 28 Mar 2010 15:55:51 -0700
Subject: [PATCH] Use iterator for STL std::map element access.

The at() function for std::map was added for libstdc++ release 4.1, and
it is not part of the official STL.

Also some developers are still using libstdc++ 4.0, so using at() will
not compile.

Instead, use an iterator for std::map element access, which is the
standard (albeit annoying) practice.
---
 lily/open-type-font.cc |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/lily/open-type-font.cc b/lily/open-type-font.cc
index de3228d..741f974 100644
--- a/lily/open-type-font.cc
+++ b/lily/open-type-font.cc
@@ -241,7 +241,16 @@ Open_type_font::name_to_index (string nm) const
 size_t
 Open_type_font::index_to_charcode (size_t i) const
 {
-  return index_to_charcode_map_.at (i);
+  map<FT_UInt, FT_ULong>::const_iterator iter;
+  iter = index_to_charcode_map_.find (i);
+
+  if (iter != index_to_charcode_map_.end ())
+    return (size_t) iter->second;
+  else
+    {
+      programming_error (_ ("Invalid index for character"));
+      return 0;
+    }
 }
 
 size_t
-- 
1.7.0.3

_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to