Hi,
During fedora 15 mass rebuild, mysql++ fails to build because of some
changes in new GCC 4.6.
In file included from ./lib/sql_buffer.h:31:0,
from ./lib/sql_buffer.cpp:26:
./lib/refcounted.h:258:2: error: 'size_t' does not name a type
From GCC documentation:
STL headers not including <cstddef> any longer
2 solutions :
- include <cstddef>
- use std::size_t
Patch proposal attached
(seems ok with previous GCC version)
Regards,
Remi.
diff -up mysql++-3.1.0/lib/refcounted.h.gcc mysql++-3.1.0/lib/refcounted.h
--- mysql++-3.1.0/lib/refcounted.h.gcc 2011-02-11 19:17:49.000000000 +0100
+++ mysql++-3.1.0/lib/refcounted.h 2011-02-11 19:18:08.000000000 +0100
@@ -101,7 +101,7 @@ public:
{
std::auto_ptr<T> exception_guard(counted_);
if (counted_) {
- refs_ = new size_t(1);
+ refs_ = new std::size_t(1);
}
exception_guard.release(); // previous new didn't throw
}
@@ -255,7 +255,7 @@ private:
/// We can't keep this as a plain integer because this object
/// allows itself to be copied. All copies need to share this
/// reference count, not just the pointer to the counted object.
- size_t* refs_;
+ std::size_t* refs_;
};