summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f96735d)
raw | patch | inline | side by side (parent: f96735d)
author | Krzysztof Kosiński <tweenk.pl@gmail.com> | |
Wed, 20 Jan 2010 19:31:57 +0000 (20:31 +0100) | ||
committer | Krzysztof Kosiński <tweenk.pl@gmail.com> | |
Wed, 20 Jan 2010 19:31:57 +0000 (20:31 +0100) |
code to detect the broken header and display Wiki page URL.
diff --git a/configure.ac b/configure.ac
index 5dac99d08a64420e83f327f429978b822dfca2f3..fde3120c6b95ef24fa7f99ca9aaaded254b9b938 100644 (file)
--- a/configure.ac
+++ b/configure.ac
# Check for some boost header files
AC_CHECK_HEADERS([boost/concept_check.hpp], [], AC_MSG_ERROR([You need the boost package (e.g. libboost-dev)]))
-# test whether GCC emits a spurious warning when using boost::optional
-# if yes, turn off strict aliasing warnings
+# Test whether GCC emits a spurious warning when using boost::optional
+# If yes, turn off strict aliasing warnings to reduce noise
AC_MSG_CHECKING([for overzealous strict aliasing warnings])
ignore_strict_aliasing=no
CXXFLAGS_SAVE=$CXXFLAGS
CXXFLAGS="$CXXFLAGS -Wno-strict-aliasing"
fi
+# Test for broken unordered_set on GCC 4.0.0, shipped with Apple XCode tools
+AC_MSG_CHECKING([TR1 unordered_set usability])
+AC_COMPILE_IFELSE([
+#include <tr1/unordered_set>
+int main() {
+ std::tr1::unordered_set<int> i, j;
+ i = j;
+ return 0;
+}
+], [unordered_set_broken=no], [unordered_set_broken=yes])
+if test "x$unordered_set_broken" = "xyes"; then
+ AC_MSG_RESULT([broken])
+ AC_MSG_ERROR([You have a broken version of the <tr1/unordered_set> header. See http://wiki.inkscape.org/wiki/index.php/CompilingMacOsX for information on how to fix this problem.])
+else
+ AC_MSG_RESULT([ok])
+fi
+
PKG_CHECK_MODULES(CAIRO_PDF, cairo-pdf, cairo_pdf=yes, cairo_pdf=no)
if test "x$cairo_pdf" = "xyes"; then
AC_DEFINE(HAVE_CAIRO_PDF, 1, [Whether the Cairo PDF backend is available])
index 761da7756e62661a8e090968900ed550f27c8366..09d9e2c4f2f92dfb2a5441ccd257d5190cc27288 100644 (file)
/* Freetype2 */
# include <pango/pangoft2.h>
-//#include <tr1/unordered_map>
-#include <ext/hash_map>
+#include <tr1/unordered_map>
-
-typedef __gnu_cxx::hash_map<PangoFontDescription*, font_instance*, font_descr_hash, font_descr_equal> FaceMapType;
+typedef std::tr1::unordered_map<PangoFontDescription*, font_instance*, font_descr_hash, font_descr_equal> FaceMapType;
// need to avoid using the size field
size_t font_descr_hash::operator()( PangoFontDescription *const &x) const {
if ( nFace ) {
// duplicate FcPattern, the hard way
res = new font_instance();
- // store the descr of the font we asked for, since this is the key where we intend to put the font_instance at
- // in the hash_map. the descr of the returned pangofont may differ from what was asked, so we don't know (at this
- // point) whether loadedFaces[that_descr] is free or not (and overwriting an entry will bring deallocation problems)
+ // store the descr of the font we asked for, since this is the key where we intend
+ // to put the font_instance at in the unordered_map. the descr of the returned
+ // pangofont may differ from what was asked, so we don't know (at this
+ // point) whether loadedFaces[that_descr] is free or not (and overwriting
+ // an entry will bring deallocation problems)
res->descr = pango_font_description_copy(descr);
res->daddy = this;
res->InstallFace(nFace);
index 8b8eb8bbe714d3f982399f5b845f844432cc8269..628e3cba0c630b1bb5dd6df0109f8bd3ceef2a09 100644 (file)
# include FT_TRUETYPE_TABLES_H
# include <pango/pangoft2.h>
-//#include <tr1/unordered_map>
-#include <ext/hash_map>
+#include <tr1/unordered_map>
-// the various raster_font in use at a given time are held in a hash_map whose indices are the
-// styles, hence the 2 following 'classes'
struct font_style_hash : public std::unary_function<font_style, size_t> {
size_t operator()(font_style const &x) const;
};
bool operator()(font_style const &a, font_style const &b) const;
};
-
-typedef __gnu_cxx::hash_map<font_style, raster_font*, font_style_hash, font_style_equal> StyleMap;
+typedef std::tr1::unordered_map<font_style, raster_font*, font_style_hash, font_style_equal> StyleMap;
index 521c9a42428db3f94884c7cee1352b4d095404de..d52bd723f1580ce6c279495f8ed85eecee3f1967 100644 (file)
// depending on the rendering backend, different temporary data
// that's the font's fingerprint; this particular PangoFontDescription gives the entry at which this font_instance
- // resides in the font_factory loadedFaces hash_map
+ // resides in the font_factory loadedFaces unordered_map
PangoFontDescription* descr;
// refcount
int refCount;
void FreeTheFace();
// hashmap to get the raster_font for a given style
- void* loadedPtr; // Pointer to a hash_map. Moved into .cpp to not expose use of __gnu_cxx extension.
+ void* loadedPtr;
#ifdef USE_PANGO_WIN32
HFONT theFace;
index dce68557589b4448063cbf9abe08a1007817c309..54d724f00062a74ff727f32c64457103a6ff090c 100644 (file)
#define SEEN_UI_TOOL_NODE_SELECTION_H
#include <memory>
-// those are broken beyond hope on OSX.
-//#include <tr1/unordered_map>
-//#include <tr1/unordered_set>
-#include <ext/hash_map>
-#include <ext/hash_set>
+#include <tr1/unordered_map>
+#include <tr1/unordered_set>
#include <boost/shared_ptr.hpp>
#include <boost/weak_ptr.hpp>
#include <boost/optional.hpp>
#include "ui/tool/commit-events.h"
#include "ui/tool/manipulator.h"
-namespace std { using namespace __gnu_cxx; }
-
class SPDesktop;
namespace Inkscape {
}
}
-namespace __gnu_cxx {
-template<>
-struct hash<Inkscape::UI::SelectableControlPoint*> {
- size_t operator()(Inkscape::UI::SelectableControlPoint *p) const {
- return reinterpret_cast<size_t>(p);
- }
-};
-} // namespace __gnu_cxx
-
namespace Inkscape {
namespace UI {
ControlPointSelection(SPDesktop *d, SPCanvasGroup *th_group);
~ControlPointSelection();
typedef std::list<sigc::connection> connlist_type;
- typedef std::hash_map< SelectableControlPoint *,
+ typedef std::tr1::unordered_map< SelectableControlPoint *,
boost::shared_ptr<connlist_type> > map_type;
- typedef std::hash_set< SelectableControlPoint * > set_type;
+ typedef std::tr1::unordered_set< SelectableControlPoint * > set_type;
typedef set_type Set; // convenience alias
typedef map_type::iterator iterator;
index c05b71cd4f3b3993437f3651d25be8dc255861e2..d1138abd5c32686c1fe5eb77d1be1fa25f18396b 100644 (file)
/** @file
- * Path manipulator - implementation
+ * Multi path manipulator - implementation
*/
/* Authors:
* Krzysztof Kosiński <tweenk.pl@gmail.com>
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-//#include <tr1/unordered_set>
-#include <ext/hash_set>
+#include <tr1/unordered_set>
#include <boost/shared_ptr.hpp>
#include <glib.h>
#include <glibmm/i18n.h>
#include "ui/tool/multi-path-manipulator.h"
#include "ui/tool/path-manipulator.h"
-namespace std { using namespace __gnu_cxx; }
-
-namespace __gnu_cxx {
-template<>
-struct hash<Inkscape::UI::NodeList::iterator> {
- size_t operator()(Inkscape::UI::NodeList::iterator const &n) const {
- return reinterpret_cast<size_t>(n.ptr());
- }
-};
-}
+namespace std { using namespace tr1; }
namespace Inkscape {
namespace UI {
namespace {
typedef std::pair<NodeList::iterator, NodeList::iterator> IterPair;
typedef std::vector<IterPair> IterPairList;
-typedef std::hash_set<NodeList::iterator> IterSet;
+typedef std::unordered_set<NodeList::iterator> IterSet;
typedef std::multimap<double, IterPair> DistanceMap;
typedef std::pair<double, IterPair> DistanceMapItem;
diff --git a/src/ui/tool/node.cpp b/src/ui/tool/node.cpp
index c1dfcdeaac72a1b86ffbda81e3e802dc6db2b085..ef98e7c84058a21f6045a2773a19f4c1a60353fa 100644 (file)
--- a/src/ui/tool/node.cpp
+++ b/src/ui/tool/node.cpp
if (state_held_control(state)) {
if (state_held_alt(state)) {
- return C_("Path node tip", "<b>Ctrl+Alt:</b> move along handle lines");
+ return C_("Path node tip", "<b>Ctrl+Alt:</b> move along handle lines, click to delete node");
}
return C_("Path node tip",
"<b>Ctrl:</b> move along axes, click to change node type");
diff --git a/src/util/hash.h b/src/util/hash.h
index 33af9222da0e0e6f1d7b5c2a7e09d76e08dfe3db..d5abeff5a7bdc11ca08fde6d1aa967498e0dbfeb 100644 (file)
--- a/src/util/hash.h
+++ b/src/util/hash.h
#include <boost/shared_ptr.hpp>
-namespace __gnu_cxx {
+namespace std {
+namespace tr1 {
/** Hash function for Boost shared pointers */
template <typename T>
}
};
-} // namespace __gnu_cxx
+} // namespace tr1
+} // namespace std
#endif