Package: tagcoll2
Version: 2.0.11-1.1
Severity: wishlist

Dear Maintainer,

A have successfully compiled tagcoll2 on x86_64-pc-solaris2.11 by GCC 4.7 with
attached patches:

1. Solaris misses fmemopen()
2. Some OOP fixes



-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.0.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=ru_RU.UTF-8, LC_CTYPE=ru_RU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Index: tagcoll2-2.0.13/tagcoll/tagexpr/Makefile.am
===================================================================
--- tagcoll2-2.0.13.orig/tagcoll/tagexpr/Makefile.am	2008-06-08 10:34:41.000000000 +0400
+++ tagcoll2-2.0.13/tagcoll/tagexpr/Makefile.am	2012-02-28 02:24:56.187174567 +0400
@@ -10,6 +10,12 @@
 		TagexprParser.cc \
 		Tagexpr_parser_y.yy Tagexpr_parser_l.ll
 
+if NO_FMEMOPEN
+libtagexpr_la_SOURCES += \
+		fmemopen.c \
+		fmemopen.h
+endif
+
 INCLUDES = -I$(top_srcdir) $(LIBWIBBLE_DEFS)
 
 AM_YFLAGS = -d
Index: tagcoll2-2.0.13/tagcoll/tagexpr/fmemopen.c
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ tagcoll2-2.0.13/tagcoll/tagexpr/fmemopen.c	2012-02-28 02:08:29.003877978 +0400
@@ -0,0 +1,13 @@
+#include <stdio.h>
+
+FILE *fmemopen (void *buf, size_t size, const char *opentype)
+{
+    FILE *f = NULL;
+    if ((f = tmpfile()) != NULL) {
+        fwrite(buf, 1, size, f);
+        rewind(f);
+    }
+    return f;
+}
+
+
Index: tagcoll2-2.0.13/tagcoll/tagexpr/fmemopen.h
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ tagcoll2-2.0.13/tagcoll/tagexpr/fmemopen.h	2012-02-28 02:10:47.903965603 +0400
@@ -0,0 +1,17 @@
+#ifndef _FMEMOPEN_H
+#define _FMEMOPEN_H
+
+#include <stdio.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern FILE *fmemopen(void *buf, size_t size, const char *mode);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _FMEMOPEN_H */
+
Index: tagcoll2-2.0.13/tagcoll/TextFormat-tut.cc
===================================================================
--- tagcoll2-2.0.13.orig/tagcoll/TextFormat-tut.cc	2008-06-08 10:34:41.000000000 +0400
+++ tagcoll2-2.0.13/tagcoll/TextFormat-tut.cc	2012-02-28 02:14:45.381372438 +0400
@@ -24,6 +24,9 @@
 #include <tagcoll/stream/sink.h>
 #include <tagcoll/patch.h>
 #include <cstring>
+#ifndef HAVE_FMEMOPEN
+#include "tagcoll/tagexpr/fmemopen.h"
+#endif
 
 namespace tut {
 using namespace std;
Index: tagcoll2-2.0.13/tagcoll/tagexpr/TagexprParser.cc
===================================================================
--- tagcoll2-2.0.13.orig/tagcoll/tagexpr/TagexprParser.cc	2008-06-08 10:34:41.000000000 +0400
+++ tagcoll2-2.0.13/tagcoll/tagexpr/TagexprParser.cc	2012-02-28 02:14:44.146738957 +0400
@@ -26,6 +26,9 @@
 #include <wibble/exception.h>
 #include <stdio.h>
 #include <errno.h>
+#ifndef HAVE_FMEMOPEN
+#include "tagcoll/tagexpr/fmemopen.h"
+#endif
 
 // using namespace std;
 using namespace wibble;
Index: tagcoll2-2.0.13/configure.ac
===================================================================
--- tagcoll2-2.0.13.orig/configure.ac	2011-09-01 20:37:05.000000000 +0400
+++ tagcoll2-2.0.13/configure.ac	2012-02-28 02:24:45.062179367 +0400
@@ -59,6 +59,9 @@
 
 CXXFLAGS="$CXXFLAGS -Wall"
 
+AC_CHECK_FUNC([fmemopen], [have_fmemopen=yes], [have_fmemopen=no])
+AM_CONDITIONAL([NO_FMEMOPEN], [test $have_fmemopen = 'no'])
+
 AC_CONFIG_FILES([
 Makefile
 tagcoll/Makefile
Index: tagcoll2-2.0.13/tagcoll/patch.tcc
===================================================================
--- tagcoll2-2.0.13.orig/tagcoll/patch.tcc	2008-06-08 10:34:41.000000000 +0400
+++ tagcoll2-2.0.13/tagcoll/patch.tcc	2012-02-28 02:32:50.135741040 +0400
@@ -53,7 +53,7 @@
 
 	iterator i = this->find(patch.item);
 	if (i == this->end())
-		insert(make_pair<ITEM, Patch<ITEM, TAG> >(patch.item, patch));
+		this->insert(make_pair<ITEM, Patch<ITEM, TAG> >(patch.item, patch));
 	else
 		i->second.mergeWith(patch);
 }
Index: tagcoll2-2.0.13/tagcoll/coll/fast.tcc
===================================================================
--- tagcoll2-2.0.13.orig/tagcoll/coll/fast.tcc	2008-06-08 10:34:41.000000000 +0400
+++ tagcoll2-2.0.13/tagcoll/coll/fast.tcc	2012-02-28 02:33:57.686441329 +0400
@@ -240,7 +240,7 @@
 template<class ITEM, class TAG>
 std::set<ITEM> Fast<ITEM, TAG>::getItemsExactMatch(const std::set<TAG>& tags) const
 {
-	std::set<ITEM> res = getItemsHavingTags(tags);
+	std::set<ITEM> res = this->getItemsHavingTags(tags);
 	typename std::set<ITEM>::iterator i = res.begin();
 	while (i != res.end())
 	{
Index: tagcoll2-2.0.13/tagcoll/Implications.h
===================================================================
--- tagcoll2-2.0.13.orig/tagcoll/Implications.h	2008-06-08 10:34:41.000000000 +0400
+++ tagcoll2-2.0.13/tagcoll/Implications.h	2012-02-28 02:34:31.870597436 +0400
@@ -107,7 +107,7 @@
 			typename std::set<TAG> implying = coll.getTagsImplying(*t);
 			for (typename std::set<TAG>::const_iterator i = implying.begin();
 					i != implying.end(); ++i)
-				insert(wibble::singleton(*i), wibble::singleton(*t));
+				this->insert(wibble::singleton(*i), wibble::singleton(*t));
 		}
 	}
 

Reply via email to