From a8456b3766c8eecf9e5d23208a1f4334e882c537 Mon Sep 17 00:00:00 2001 From: Michael Fisher Date: Tue, 16 Jul 2013 20:46:46 -0500 Subject: [PATCH 1/3] Proper OSX/CLANG/CXX11 support in stl_delete.h - replaces fix in 066df0d218ee4391eb3e15259deca5ccc190ed84 - Check if _LIBCPP_VECTOR is defined for vector_delete. This is defined in libc++'s headers which Apple is using instead of libstdc++ --- libs/pbd/pbd/stl_delete.h | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/libs/pbd/pbd/stl_delete.h b/libs/pbd/pbd/stl_delete.h index ac2161560c..bca0ea9e21 100644 --- a/libs/pbd/pbd/stl_delete.h +++ b/libs/pbd/pbd/stl_delete.h @@ -21,17 +21,10 @@ #define __libmisc_stl_delete_h__ -#if __clang__ && __APPLE__ && __cplusplus >= 201103L -#include -#ifndef _CPP_VECTOR -#define _CPP_VECTOR -#endif -#endif - /* To actually use any of these deletion functions, you need to first include the revelant container type header. */ -#if defined(_CPP_VECTOR) || defined(_GLIBCXX_VECTOR) || defined(__SGI_STL_VECTOR) +#if defined(_CPP_VECTOR) || defined(_GLIBCXX_VECTOR) || defined(__SGI_STL_VECTOR) || defined(_LIBCPP_VECTOR) template void vector_delete (std::vector *vec) { typename std::vector::iterator i; @@ -41,7 +34,7 @@ template void vector_delete (std::vector *vec) } vec->clear (); } -#endif // _CPP_VECTOR || _GLIBCXX_VECTOR || __SGI_STL_VECTOR +#endif // _CPP_VECTOR || _GLIBCXX_VECTOR || __SGI_STL_VECTOR || _LIBCPP_VECTOR #if defined(_CPP_MAP) || defined(_GLIBCXX_MAP) || defined(__SGI_STL_MAP) template void map_delete (std::map *m) From cdc9d95e925568f0b7808b3ca1f4036fbc66bcdd Mon Sep 17 00:00:00 2001 From: Michael Fisher Date: Wed, 17 Jul 2013 16:05:09 -0500 Subject: [PATCH 2/3] Cast param for std::time to a pointer of time_t - bleeding clang (trunk 186535 v3.4) fails here --- libs/ardour/audiosource.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/ardour/audiosource.cc b/libs/ardour/audiosource.cc index 74dd52d504..84a5b687f9 100644 --- a/libs/ardour/audiosource.cc +++ b/libs/ardour/audiosource.cc @@ -182,7 +182,7 @@ AudioSource::touch_peakfile () struct utimbuf tbuf; tbuf.actime = statbuf.st_atime; - tbuf.modtime = time ((time_t) 0); + tbuf.modtime = time ((time_t*) 0); utime (peakpath.c_str(), &tbuf); } From 6fd7ec3fc94b517df184bfe1be11fb16580a280b Mon Sep 17 00:00:00 2001 From: Michael Fisher Date: Fri, 19 Jul 2013 17:40:16 -0500 Subject: [PATCH 3/3] Return an empty string instead of a bool --- libs/ardour/audio_unit.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libs/ardour/audio_unit.cc b/libs/ardour/audio_unit.cc index 20a55e49f9..e43033eb67 100644 --- a/libs/ardour/audio_unit.cc +++ b/libs/ardour/audio_unit.cc @@ -1824,7 +1824,6 @@ AUPlugin::do_save_preset (string preset_name) CFPropertyListRef propertyList; vector v; Glib::ustring user_preset_path; - bool ret = true; std::string m = maker(); std::string n = name(); @@ -1843,12 +1842,12 @@ AUPlugin::do_save_preset (string preset_name) if (g_mkdir_with_parents (user_preset_path.c_str(), 0775) < 0) { error << string_compose (_("Cannot create user plugin presets folder (%1)"), user_preset_path) << endmsg; - return false; + return string(); } DEBUG_TRACE (DEBUG::AudioUnits, "get current preset\n"); if (unit->GetAUPreset (propertyList) != noErr) { - return false; + return string(); } // add the actual preset name */ @@ -1863,7 +1862,7 @@ AUPlugin::do_save_preset (string preset_name) if (save_property_list (propertyList, user_preset_path)) { error << string_compose (_("Saving plugin state to %1 failed"), user_preset_path) << endmsg; - ret = false; + return string(); } CFRelease(propertyList);