diff options
author | Josh Haberman <jhaberman@gmail.com> | 2013-05-28 15:26:44 -0700 |
---|---|---|
committer | Josh Haberman <jhaberman@gmail.com> | 2013-05-28 15:26:44 -0700 |
commit | 228872a5c68938c56eb9d4ecd2413865b5277fe1 (patch) | |
tree | c603c149e99b437fab018877d29289c0a0ff7aeb /upb/handlers.h | |
parent | bada1e94f472e7507a97e7565369841b3d25c9b0 (diff) |
Fixes to compile on GCC 4.2, as shipped with XCode.
Diffstat (limited to 'upb/handlers.h')
-rw-r--r-- | upb/handlers.h | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/upb/handlers.h b/upb/handlers.h index a80e401..2108046 100644 --- a/upb/handlers.h +++ b/upb/handlers.h @@ -116,13 +116,13 @@ class upb::Handlers { typedef Handler<bool(*)(void *, const void *, T)> H; }; - typedef ValueHandler<upb_int32_t>::H Int32Handler; - typedef ValueHandler<upb_int64_t>::H Int64Handler; - typedef ValueHandler<upb_uint32_t>::H UInt32Handler; - typedef ValueHandler<upb_uint64_t>::H UInt64Handler; - typedef ValueHandler<float>::H FloatHandler; - typedef ValueHandler<double>::H DoubleHandler; - typedef ValueHandler<bool>::H BoolHandler; + typedef ValueHandler<int32_t>::H Int32Handler; + typedef ValueHandler<int64_t>::H Int64Handler; + typedef ValueHandler<uint32_t>::H UInt32Handler; + typedef ValueHandler<uint64_t>::H UInt64Handler; + typedef ValueHandler<float>::H FloatHandler; + typedef ValueHandler<double>::H DoubleHandler; + typedef ValueHandler<bool>::H BoolHandler; // Any function pointer can be converted to this and converted back to its // correct type. @@ -470,8 +470,14 @@ template <class T> class Handler { Handler(FuncPtr h, void *d, void (*c)(void *)) : handler_(h), data_(d), cleanup_(c), registered_(false) {} - Handler(const Handler&); void operator=(const Handler&); +#ifdef UPB_CXX11 + // C++98 doesn't support binding a const ref to a temporary, at least + // according to Clang. It is still intended that users NOT create instances + // of this object via this copy constructor, and any attempts to register + // such an object more than once will assert-fail. + Handler(const Handler&); +#endif FuncPtr handler_; void *data_; |