summaryrefslogtreecommitdiff
blob: 1b341d167b6f39fb62c45d282ed23cb3a26db90b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
Index: tests/src/binaryio-test.hh
===================================================================
--- tests/src/binaryio-test.hh	(revision 223)
+++ tests/src/binaryio-test.hh	(revision 224)
@@ -115,11 +115,10 @@
         if (not stream)
             throw herdstat::FileException("bar");
 
-        herdstat::io::BinaryIStreamIterator<std::string> strEOF;
+        std::vector<std::string> s2;
+        s2.assign(herdstat::io::BinaryIStreamIterator<std::string>(stream),
+                  herdstat::io::BinaryIStreamIterator<std::string>());
 
-        std::vector<std::string> s2(
-                herdstat::io::BinaryIStreamIterator<std::string>(stream), strEOF);
-
         std::cout << "s2 = '";
         std::copy(s2.begin(), s2.end(),
             std::ostream_iterator<std::string>(std::cout, " "));
Index: configure.ac
===================================================================
--- configure.ac	(revision 223)
+++ configure.ac	(revision 224)
@@ -10,8 +10,8 @@
 VERSION_MAJOR=0
 VERSION_MINOR=2
 VERSION_MICRO=0
-VERSION_SUFFIX=
-VERSION_SUFFIX_VERSION=
+VERSION_SUFFIX=p
+VERSION_SUFFIX_VERSION=1
 VERSION_FULL="$VERSION_MAJOR.$VERSION_MINOR.$VERSION_MICRO"
 
 if ! test -z "$VERSION_SUFFIX" ; then
@@ -104,6 +104,41 @@
     AC_DEFINE_UNQUOTED(HAVE_GCC4, 1, [GCC Version 4])
 fi
 
+AC_MSG_CHECKING([if ${CXX} supports __attribute__ ((unused))])
+AC_COMPILE_IFELSE(AC_LANG_PROGRAM([
+#include <stdio.h>
+void foo(int x __attribute__ ((unused)))
+{ printf("foo\n"); }
+],[
+    int i = 10;
+    foo(i);
+    return 0;
+    ]),
+    [HAS_ATTR_UNUSED="yes"],[HAS_ATTR_UNUSED="no"])
+AC_MSG_RESULT([$HAS_ATTR_UNUSED])
+
+if test "x$HAS_ATTR_UNUSED" = "xyes" ; then
+    AC_DEFINE(HAVE_ATTR_UNUSED, 1, [C compiler supports the unused attribute])
+fi
+
+AC_MSG_CHECKING([if ${CXX} supports __attribute__ ((deprecated))])
+AC_COMPILE_IFELSE(AC_LANG_PROGRAM([
+class __attribute__ ((deprecated)) Foo
+{
+    public:
+	Foo() __attribute__ ((deprecated)) { }
+};
+],[
+    Foo foo;
+    return 0;
+    ]),
+    [HAS_ATTR_DEPRECAED="yes"],[HAS_ATTR_DEPRECAED="no"])
+AC_MSG_RESULT([$HAS_ATTR_DEPRECAED])
+
+if test "x$HAS_ATTR_DEPRECAED" = "xyes" ; then
+    AC_DEFINE(HAVE_ATTR_DEPRECATED, 1, [C compiler supports the deprecated attribute])
+fi
+
 LHS_CHECK_CXXFLAG([-pedantic])
 LHS_CHECK_CXXFLAG([-ansi])
 LHS_CHECK_CXXFLAG([-W])
Index: herdstat/defs.hh
===================================================================
--- herdstat/defs.hh	(revision 223)
+++ herdstat/defs.hh	(revision 224)
@@ -35,7 +35,7 @@
 #define NELEMS(x) (sizeof(x) / sizeof(x[0]))
 
 #ifndef LIBHERDSTAT_DEPRECATED
-# if defined(__GNUC__) || defined(DOXYGEN)
+# if defined(HAVE_ATTR_DEPRECATED) || defined(DOXYGEN)
 #   define LIBHERDSTAT_DEPRECATED __attribute__ ((deprecated))
 # else
 #   define LIBHERDSTAT_DEPRECATED
@@ -43,7 +43,7 @@
 #endif
 
 #ifndef LIBHERDSTAT_UNUSED
-# if defined(__GNUC__) || defined(DOXYGEN)
+# if defined(HAVE_ATTR_UNUSED) || defined(DOXYGEN)
 #   define LIBHERDSTAT_UNUSED __attribute__ ((unused))
 # else
 #   define LIBHERDSTAT_UNUSED
Index: herdstat/fetcher/impmap.cc
===================================================================
--- herdstat/fetcher/impmap.cc	(revision 223)
+++ herdstat/fetcher/impmap.cc	(revision 224)
@@ -24,6 +24,8 @@
 # include "config.h"
 #endif
 
+#include <cassert>
+
 #include <herdstat/fetcher/curlfetcher.hh>
 #include <herdstat/fetcher/wgetfetcher.hh>
 #include <herdstat/fetcher/impmap.hh>
Index: herdstat/portage/exceptions.cc
===================================================================
--- herdstat/portage/exceptions.cc	(revision 223)
+++ herdstat/portage/exceptions.cc	(revision 224)
@@ -24,6 +24,8 @@
 # include "config.h"
 #endif
 
+#include <cassert>
+
 #include <herdstat/portage/exceptions.hh>
 
 namespace herdstat {
Index: herdstat/io/binary_stream.cc
===================================================================
--- herdstat/io/binary_stream.cc	(revision 223)
+++ herdstat/io/binary_stream.cc	(revision 224)
@@ -24,6 +24,7 @@
 # include "config.h"
 #endif
 
+#include <cassert>
 #include <herdstat/io/binary_stream.hh>
 
 namespace herdstat {
Index: herdstat/util/file.hh
===================================================================
--- herdstat/util/file.hh	(revision 223)
+++ herdstat/util/file.hh	(revision 224)
@@ -39,6 +39,7 @@
 #include <vector>
 #include <cstdlib>
 #include <cerrno>
+#include <cassert>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>