From 143cc3b696f73e3ac9455fe2608b6aeff9965bee Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Tue, 23 Feb 2016 14:26:31 -0800 Subject: [PATCH] Fix compilation with GCC 4.9 4.9 does not correctly implement C++14 aggregate initialization. --- src/impl/apple/cached_realm.cpp | 4 ++-- src/parser/parser.hpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/impl/apple/cached_realm.cpp b/src/impl/apple/cached_realm.cpp index 33ade9a0..562d9a72 100644 --- a/src/impl/apple/cached_realm.cpp +++ b/src/impl/apple/cached_realm.cpp @@ -30,11 +30,11 @@ CachedRealm::CachedRealm(const std::shared_ptr& realm, bool cache) { struct RefCountedWeakPointer { std::weak_ptr realm; - std::atomic ref_count = {1}; + std::atomic ref_count; }; CFRunLoopSourceContext ctx{}; - ctx.info = new RefCountedWeakPointer{realm}; + ctx.info = new RefCountedWeakPointer{realm, {1}}; ctx.perform = [](void* info) { if (auto realm = static_cast(info)->realm.lock()) { realm->notify(); diff --git a/src/parser/parser.hpp b/src/parser/parser.hpp index 39834dde..0becab08 100644 --- a/src/parser/parser.hpp +++ b/src/parser/parser.hpp @@ -28,7 +28,7 @@ class Schema; namespace parser { struct Expression { - enum class Type { None, Number, String, KeyPath, Argument, True, False } type = Type::None; + enum class Type { None, Number, String, KeyPath, Argument, True, False } type; std::string s; }; @@ -60,7 +60,7 @@ struct Predicate struct Comparison { Operator op = Operator::None; - Expression expr[2]; + Expression expr[2] = {{Expression::Type::None, ""}, {Expression::Type::None, ""}}; }; struct Compound