From 428adf706fe868a7093c0c89f80925ba115e64ca Mon Sep 17 00:00:00 2001 From: ThePhD Date: Fri, 16 Dec 2016 01:00:49 -0500 Subject: [PATCH] optional impl alignment requirements?? Thanks, Emscripten. --- single/sol/sol.hpp | 12 ++++++------ sol/optional_implementation.hpp | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/single/sol/sol.hpp b/single/sol/sol.hpp index 79794ded..03aab2ed 100644 --- a/single/sol/sol.hpp +++ b/single/sol/sol.hpp @@ -20,8 +20,8 @@ // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // This file was generated with a script. -// Generated 2016-12-16 05:28:22.940422 UTC -// This header was generated with sol v2.15.5 (revision bbcbd41) +// Generated 2016-12-16 06:00:39.206011 UTC +// This header was generated with sol v2.15.5 (revision e1329d2) // https://github.com/ThePhD/sol2 #ifndef SOL_SINGLE_INCLUDE_HPP @@ -2089,8 +2089,8 @@ namespace sol { }; template - struct optional_base { - char storage_[sizeof(T) + (sizeof(T) % alignof(T))]; + struct alignas(T) optional_base { + char storage_[sizeof(T)]; bool init_; constexpr optional_base() noexcept : storage_(), init_(false) {}; @@ -2137,8 +2137,8 @@ namespace sol { using constexpr_optional_base = optional_base; #else template - struct constexpr_optional_base { - char storage_[sizeof(T) + (sizeof(T) % alignof(T))]; + struct alignas(T) constexpr_optional_base { + char storage_[sizeof(T)]; bool init_; constexpr constexpr_optional_base() noexcept : storage_(), init_(false) {} diff --git a/sol/optional_implementation.hpp b/sol/optional_implementation.hpp index 7ed7fcd2..4ffd0f27 100644 --- a/sol/optional_implementation.hpp +++ b/sol/optional_implementation.hpp @@ -287,8 +287,8 @@ namespace sol { template - struct optional_base { - char storage_[sizeof(T) + (sizeof(T) % alignof(T))]; + struct alignas(T) optional_base { + char storage_[sizeof(T)]; bool init_; constexpr optional_base() noexcept : storage_(), init_(false) {}; @@ -335,8 +335,8 @@ namespace sol { using constexpr_optional_base = optional_base; #else template - struct constexpr_optional_base { - char storage_[sizeof(T) + (sizeof(T) % alignof(T))]; + struct alignas(T) constexpr_optional_base { + char storage_[sizeof(T)]; bool init_; constexpr constexpr_optional_base() noexcept : storage_(), init_(false) {}