diff options
author | Vitaly Buka <vitalybuka@google.com> | 2015-11-24 14:46:13 -0800 |
---|---|---|
committer | Alex Vakulenko <avakulenko@google.com> | 2015-11-25 19:17:46 +0000 |
commit | 3bfb13d1a7a1d1677b3b3af9264f7cbecb6b71bd (patch) | |
tree | f5157604bf8f47280adf8c84f98d07bc78d669b1 | |
parent | c4305600835b91630f9ca4b10ad9070ea55a726c (diff) | |
download | libweave-3bfb13d1a7a1d1677b3b3af9264f7cbecb6b71bd.tar.gz |
Fix GCC 4.7 errors
GCC 4.7.2 fail overriding constructors defined with virtual and default.
Debian build also fails linking without -lrt.
INT64_C is not defined on Debian with 4.7.2. "ll" should be enough.
Change-Id: Ia779f094ed64fc3b1941429485e81520d017c2f5
Reviewed-on: https://weave-review.googlesource.com/1671
Reviewed-by: Alex Vakulenko <avakulenko@google.com>
25 files changed, 29 insertions, 28 deletions
diff --git a/include/weave/command.h b/include/weave/command.h index 08ea782..0a7d545 100644 --- a/include/weave/command.h +++ b/include/weave/command.h @@ -79,7 +79,7 @@ class Command { virtual bool Cancel(ErrorPtr* error) = 0; protected: - virtual ~Command() = default; + virtual ~Command() {} }; } // namespace weave diff --git a/include/weave/device.h b/include/weave/device.h index cbcc193..5e86dfd 100644 --- a/include/weave/device.h +++ b/include/weave/device.h @@ -32,7 +32,7 @@ enum class GcdState { class Device { public: - virtual ~Device() = default; + virtual ~Device() {} // Returns reference the current settings. virtual const Settings& GetSettings() const = 0; diff --git a/include/weave/provider/bluetooth.h b/include/weave/provider/bluetooth.h index e8f3b3c..6a47e92 100644 --- a/include/weave/provider/bluetooth.h +++ b/include/weave/provider/bluetooth.h @@ -14,7 +14,7 @@ class Bluetooth { // TODO(rginda): Add bluetooth interface methods here. protected: - virtual ~Bluetooth() = default; + virtual ~Bluetooth() {} }; } // namespace provider diff --git a/include/weave/provider/config_store.h b/include/weave/provider/config_store.h index 53c1128..1b7988f 100644 --- a/include/weave/provider/config_store.h +++ b/include/weave/provider/config_store.h @@ -75,7 +75,7 @@ class ConfigStore { virtual void SaveSettings(const std::string& settings) = 0; protected: - virtual ~ConfigStore() = default; + virtual ~ConfigStore() {} }; } // namespace provider diff --git a/include/weave/provider/dns_service_discovery.h b/include/weave/provider/dns_service_discovery.h index fa9d50e..37bf84b 100644 --- a/include/weave/provider/dns_service_discovery.h +++ b/include/weave/provider/dns_service_discovery.h @@ -91,7 +91,7 @@ class DnsServiceDiscovery { virtual void StopPublishing(const std::string& service_type) = 0; protected: - virtual ~DnsServiceDiscovery() = default; + virtual ~DnsServiceDiscovery() {} }; } // namespace provider diff --git a/include/weave/provider/http_client.h b/include/weave/provider/http_client.h index deb127a..bf01022 100644 --- a/include/weave/provider/http_client.h +++ b/include/weave/provider/http_client.h @@ -78,7 +78,7 @@ class HttpClient { virtual std::string GetContentType() const = 0; virtual std::string GetData() const = 0; - virtual ~Response() = default; + virtual ~Response() {} }; using Headers = std::vector<std::pair<std::string, std::string>>; @@ -92,7 +92,7 @@ class HttpClient { const SendRequestCallback& callback) = 0; protected: - virtual ~HttpClient() = default; + virtual ~HttpClient() {} }; } // namespace provider diff --git a/include/weave/provider/http_server.h b/include/weave/provider/http_server.h index 622785b..1c28d63 100644 --- a/include/weave/provider/http_server.h +++ b/include/weave/provider/http_server.h @@ -109,7 +109,7 @@ class HttpServer { public: class Request { public: - virtual ~Request() = default; + virtual ~Request() {} virtual std::string GetPath() const = 0; virtual std::string GetFirstHeader(const std::string& name) const = 0; @@ -141,7 +141,7 @@ class HttpServer { virtual base::TimeDelta GetRequestTimeout() const = 0; protected: - virtual ~HttpServer() = default; + virtual ~HttpServer() {} }; } // namespace provider diff --git a/include/weave/provider/network.h b/include/weave/provider/network.h index 651155a..0fb147d 100644 --- a/include/weave/provider/network.h +++ b/include/weave/provider/network.h @@ -47,7 +47,7 @@ class Network { const OpenSslSocketCallback& callback) = 0; protected: - virtual ~Network() = default; + virtual ~Network() {} }; } // namespace provider diff --git a/include/weave/provider/task_runner.h b/include/weave/provider/task_runner.h index 0804a10..095910b 100644 --- a/include/weave/provider/task_runner.h +++ b/include/weave/provider/task_runner.h @@ -28,7 +28,7 @@ class TaskRunner { base::TimeDelta delay) = 0; protected: - virtual ~TaskRunner() = default; + virtual ~TaskRunner() {} }; } // namespace provider diff --git a/include/weave/provider/wifi.h b/include/weave/provider/wifi.h index 111bf3c..48ac651 100644 --- a/include/weave/provider/wifi.h +++ b/include/weave/provider/wifi.h @@ -29,7 +29,7 @@ class Wifi { virtual void StopAccessPoint() = 0; protected: - virtual ~Wifi() = default; + virtual ~Wifi() {} }; } // namespace provider diff --git a/include/weave/stream.h b/include/weave/stream.h index 19d38a0..14cc7f0 100644 --- a/include/weave/stream.h +++ b/include/weave/stream.h @@ -15,7 +15,7 @@ namespace weave { // Interface for async input streaming. class InputStream { public: - virtual ~InputStream() = default; + virtual ~InputStream() {} // Callback type for Read. using ReadCallback = base::Callback<void(size_t size, ErrorPtr error)>; @@ -31,7 +31,7 @@ class InputStream { // Interface for async input streaming. class OutputStream { public: - virtual ~OutputStream() = default; + virtual ~OutputStream() {} using WriteCallback = base::Callback<void(ErrorPtr error)>; @@ -47,7 +47,7 @@ class OutputStream { // Interface for async bi-directional streaming. class Stream : public InputStream, public OutputStream { public: - ~Stream() override = default; + ~Stream() override {} // Cancels all pending read or write requests. Canceled operations must not // call any callbacks. diff --git a/libweave_standalone.gyp b/libweave_standalone.gyp index d6418db..d36d208 100644 --- a/libweave_standalone.gyp +++ b/libweave_standalone.gyp @@ -12,6 +12,7 @@ '-lgmock', '-lgtest', '-lpthread', + '-lrt', ], }, 'targets': [ diff --git a/src/backoff_entry.h b/src/backoff_entry.h index 2df0d8a..002fb8d 100644 --- a/src/backoff_entry.h +++ b/src/backoff_entry.h @@ -57,7 +57,7 @@ class BackoffEntry { // Lifetime of policy must enclose lifetime of BackoffEntry. The // pointer must be valid but is not dereferenced during construction. explicit BackoffEntry(const Policy* const policy); - virtual ~BackoffEntry() = default; + virtual ~BackoffEntry() {} // Inform this item that a request for the network resource it is // tracking was made, and whether it failed or succeeded. diff --git a/src/commands/cloud_command_update_interface.h b/src/commands/cloud_command_update_interface.h index 9538960..ed3aa7a 100644 --- a/src/commands/cloud_command_update_interface.h +++ b/src/commands/cloud_command_update_interface.h @@ -21,7 +21,7 @@ class CloudCommandUpdateInterface { const DoneCallback& callback) = 0; protected: - virtual ~CloudCommandUpdateInterface() = default; + virtual ~CloudCommandUpdateInterface() {} }; } // namespace weave diff --git a/src/commands/command_instance.h b/src/commands/command_instance.h index 60620a1..32a93a9 100644 --- a/src/commands/command_instance.h +++ b/src/commands/command_instance.h @@ -37,7 +37,7 @@ class CommandInstance final : public Command { virtual void OnStateChanged() = 0; protected: - virtual ~Observer() = default; + virtual ~Observer() {} }; // Construct a command instance given the full command |name| which must diff --git a/src/notification/notification_channel.h b/src/notification/notification_channel.h index 5fb7993..ef152a8 100644 --- a/src/notification/notification_channel.h +++ b/src/notification/notification_channel.h @@ -17,7 +17,7 @@ class NotificationDelegate; class NotificationChannel { public: - virtual ~NotificationChannel() = default; + virtual ~NotificationChannel() {} virtual std::string GetName() const = 0; virtual bool IsConnected() const = 0; diff --git a/src/notification/notification_delegate.h b/src/notification/notification_delegate.h index 719d76d..263c2f3 100644 --- a/src/notification/notification_delegate.h +++ b/src/notification/notification_delegate.h @@ -24,7 +24,7 @@ class NotificationDelegate { virtual void OnDeviceDeleted(const std::string& cloud_id) = 0; protected: - virtual ~NotificationDelegate() = default; + virtual ~NotificationDelegate() {} }; } // namespace weave diff --git a/src/notification/xmpp_channel.h b/src/notification/xmpp_channel.h index e6185d9..50e84d2 100644 --- a/src/notification/xmpp_channel.h +++ b/src/notification/xmpp_channel.h @@ -33,7 +33,7 @@ class XmppChannelInterface { virtual void SendMessage(const std::string& message) = 0; protected: - virtual ~XmppChannelInterface() = default; + virtual ~XmppChannelInterface() {} }; class XmppChannel : public NotificationChannel, diff --git a/src/notification/xmpp_stream_parser.h b/src/notification/xmpp_stream_parser.h index 41faaff..b8f5723 100644 --- a/src/notification/xmpp_stream_parser.h +++ b/src/notification/xmpp_stream_parser.h @@ -49,7 +49,7 @@ class XmppStreamParser final { virtual void OnStanza(std::unique_ptr<XmlNode> stanza) = 0; protected: - virtual ~Delegate() = default; + virtual ~Delegate() {} }; explicit XmppStreamParser(Delegate* delegate); diff --git a/src/privet/cloud_delegate.h b/src/privet/cloud_delegate.h index 8763fbe..6396519 100644 --- a/src/privet/cloud_delegate.h +++ b/src/privet/cloud_delegate.h @@ -45,7 +45,7 @@ class CloudDelegate { class Observer { public: - virtual ~Observer() = default; + virtual ~Observer() {} virtual void OnDeviceInfoChanged() {} virtual void OnCommandDefsChanged() {} diff --git a/src/privet/security_delegate.h b/src/privet/security_delegate.h index 1d28ba3..40f297f 100644 --- a/src/privet/security_delegate.h +++ b/src/privet/security_delegate.h @@ -19,7 +19,7 @@ namespace privet { // Interface to provide Security related logic for |PrivetHandler|. class SecurityDelegate { public: - virtual ~SecurityDelegate() = default; + virtual ~SecurityDelegate() {} // Creates access token for the given scope, user id and |time|. virtual std::string CreateAccessToken(const UserInfo& user_info, diff --git a/src/privet/security_manager.h b/src/privet/security_manager.h index c99201b..bb513e6 100644 --- a/src/privet/security_manager.h +++ b/src/privet/security_manager.h @@ -41,7 +41,7 @@ class SecurityManager : public SecurityDelegate { class KeyExchanger { public: - virtual ~KeyExchanger() = default; + virtual ~KeyExchanger() {} virtual const std::string& GetMessage() = 0; virtual bool ProcessMessage(const std::string& message, diff --git a/src/privet/wifi_delegate.h b/src/privet/wifi_delegate.h index ae5e520..9bd5157 100644 --- a/src/privet/wifi_delegate.h +++ b/src/privet/wifi_delegate.h @@ -18,7 +18,7 @@ namespace privet { class WifiDelegate { public: WifiDelegate() = default; - virtual ~WifiDelegate() = default; + virtual ~WifiDelegate() {} // Returns status of the WiFi connection. virtual const ConnectionState& GetConnectionState() const = 0; diff --git a/third_party/chromium/base/time/time_posix.cc b/third_party/chromium/base/time/time_posix.cc index b625af6..2825ce5 100644 --- a/third_party/chromium/base/time/time_posix.cc +++ b/third_party/chromium/base/time/time_posix.cc @@ -117,7 +117,7 @@ struct timespec TimeDelta::ToTimeSpec() const { // => Thu Jan 01 00:00:00 UTC 1970 // irb(main):011:0> Time.at(-11644473600).getutc() // => Mon Jan 01 00:00:00 UTC 1601 -static const int64 kWindowsEpochDeltaSeconds = INT64_C(11644473600); +static const int64 kWindowsEpochDeltaSeconds = 11644473600ll; // static const int64 Time::kWindowsEpochDeltaMicroseconds = diff --git a/third_party/chromium/base/time/time_unittest.cc b/third_party/chromium/base/time/time_unittest.cc index 43373e7..508244a 100644 --- a/third_party/chromium/base/time/time_unittest.cc +++ b/third_party/chromium/base/time/time_unittest.cc @@ -584,7 +584,7 @@ TEST(TimeDelta, WindowsEpoch) { exploded.millisecond = 0; Time t = Time::FromUTCExploded(exploded); // Unix 1970 epoch. - EXPECT_EQ(INT64_C(11644473600000000), t.ToInternalValue()); + EXPECT_EQ(11644473600000000ll, t.ToInternalValue()); // We can't test 1601 epoch, since the system time functions on Linux // only compute years starting from 1900. |