diff --git a/src/Magnum/Vk/Device.cpp b/src/Magnum/Vk/Device.cpp index dcfad66a1..4d33936d2 100644 --- a/src/Magnum/Vk/Device.cpp +++ b/src/Magnum/Vk/Device.cpp @@ -119,7 +119,10 @@ DeviceCreateInfo::DeviceCreateInfo(Instance& instance, const Flags flags): Devic DeviceCreateInfo::DeviceCreateInfo(NoInitT) noexcept {} -DeviceCreateInfo::DeviceCreateInfo(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo& info): _physicalDevice{physicalDevice}, _info{info} {} +DeviceCreateInfo::DeviceCreateInfo(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo& info): _physicalDevice{physicalDevice}, + /* Can't use {} with GCC 4.8 here because it tries to initialize the first + member instead of doing a copy */ + _info(info) {} DeviceCreateInfo::~DeviceCreateInfo() = default; @@ -308,7 +311,13 @@ Device::Device(Instance& instance, const DeviceCreateInfo& info): Device::Device(NoCreateT): _handle{}, _functionPointers{} {} -Device::Device(Device&& other) noexcept: _handle{other._handle}, _flags{other._flags}, _version{other._version}, _extensionStatus{other._extensionStatus}, _state{std::move(other._state)}, _functionPointers{other._functionPointers} { +Device::Device(Device&& other) noexcept: _handle{other._handle}, + _flags{other._flags}, _version{other._version}, + _extensionStatus{other._extensionStatus}, _state{std::move(other._state)}, + /* Can't use {} with GCC 4.8 here because it tries to initialize the first + member instead of doing a copy */ + _functionPointers(other._functionPointers) +{ other._handle = nullptr; other._functionPointers = {}; } diff --git a/src/Magnum/Vk/Enums.cpp b/src/Magnum/Vk/Enums.cpp index ad8b6d063..6a45dfe0e 100644 --- a/src/Magnum/Vk/Enums.cpp +++ b/src/Magnum/Vk/Enums.cpp @@ -59,24 +59,27 @@ constexpr VkIndexType IndexTypeMapping[]{ static_assert(VK_FORMAT_UNDEFINED == 0, "VK_FORMAT_UNDEFINED is assumed to be 0"); constexpr VkFormat VertexFormatMapping[] { + /* GCC 4.8 doesn't like just a {} for default enum values */ #define _c(input, format) VK_FORMAT_ ## format, - #define _s(input) {}, + #define _s(input) VkFormat{}, #include "Magnum/Vk/Implementation/vertexFormatMapping.hpp" #undef _s #undef _c }; constexpr VkFormat PixelFormatMapping[] { + /* GCC 4.8 doesn't like just a {} for default enum values */ #define _c(input, format) VK_FORMAT_ ## format, - #define _s(input) {}, + #define _s(input) VkFormat{}, #include "Magnum/Vk/Implementation/pixelFormatMapping.hpp" #undef _s #undef _c }; constexpr VkFormat CompressedPixelFormatMapping[] { + /* GCC 4.8 doesn't like just a {} for default enum values */ #define _c(input, format) VK_FORMAT_ ## format, - #define _s(input) {}, + #define _s(input) VkFormat{}, #include "Magnum/Vk/Implementation/compressedPixelFormatMapping.hpp" #undef _s #undef _c diff --git a/src/Magnum/Vk/Instance.cpp b/src/Magnum/Vk/Instance.cpp index eaece5549..0a105d0ed 100644 --- a/src/Magnum/Vk/Instance.cpp +++ b/src/Magnum/Vk/Instance.cpp @@ -142,7 +142,10 @@ InstanceCreateInfo::InstanceCreateInfo(const Int argc, const char** const argv, InstanceCreateInfo::InstanceCreateInfo(NoInitT) noexcept {} -InstanceCreateInfo::InstanceCreateInfo(const VkInstanceCreateInfo& info): _info{info} {} +InstanceCreateInfo::InstanceCreateInfo(const VkInstanceCreateInfo& info): + /* Can't use {} with GCC 4.8 here because it tries to initialize the first + member instead of doing a copy */ + _info(info) {} InstanceCreateInfo::~InstanceCreateInfo() = default; @@ -300,7 +303,13 @@ Instance::Instance(const InstanceCreateInfo& info): _flags{HandleFlag::DestroyOn Instance::Instance(NoCreateT): _handle{}, _functionPointers{} {} -Instance::Instance(Instance&& other) noexcept: _handle{other._handle}, _flags{other._flags}, _version{other._version}, _extensionStatus{other._extensionStatus}, _state{std::move(other._state)}, _functionPointers{other._functionPointers} { +Instance::Instance(Instance&& other) noexcept: _handle{other._handle}, + _flags{other._flags}, _version{other._version}, + _extensionStatus{other._extensionStatus}, _state{std::move(other._state)}, + /* Can't use {} with GCC 4.8 here because it tries to initialize the first + member instead of doing a copy */ + _functionPointers(other._functionPointers) +{ other._handle = nullptr; other._functionPointers = {}; }