[gjs/master.msvc] arg.cpp: Add required messages for static_assert



commit 11d71c8f82c8f4cb55c1cf6453c11c0963ab413b
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Mon Jun 1 11:53:11 2020 +0800

    arg.cpp: Add required messages for static_assert
    
    Using static_assert without a diagnostic message is a feature that is
    introduced with C++17, so add the messages as needed as we are on C++14.
    
    This also reverts commit 698d603c27596f1f1c6c8309f9cbd4a77103740f, as we no
    longer need to force C++17 mode on Visual Studio as a result

 gi/arg.cpp  | 6 ++++--
 meson.build | 1 -
 2 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/gi/arg.cpp b/gi/arg.cpp
index da36f09e..71219a72 100644
--- a/gi/arg.cpp
+++ b/gi/arg.cpp
@@ -494,9 +494,11 @@ GJS_JSAPI_RETURN_CONVENTION static bool hashtable_int_key(
 
     static_assert(std::is_integral<IntType>::value, "Need an integer");
     static_assert(std::numeric_limits<Container>::max() >=
-                  std::numeric_limits<IntType>::max());
+                  std::numeric_limits<IntType>::max(),
+                  "Max possible Container value must be at least the max possible IntType value");
     static_assert(std::numeric_limits<Container>::min() <=
-                  std::numeric_limits<IntType>::min());
+                  std::numeric_limits<IntType>::min(),
+                  "Minimum possible Container value must be at most the minimum possible IntType value");
 
     if (!js_value_convert<Container>(cx, value, &i))
         return false;
diff --git a/meson.build b/meson.build
index a785f843..574ae1b1 100644
--- a/meson.build
+++ b/meson.build
@@ -502,7 +502,6 @@ libgjs = shared_library(meson.project_name(),
     link_args: link_args, link_depends: [symbol_map, symbol_list],
     link_with: libgjs_jsapi,
     dependencies: libgjs_dependencies,
-    override_options: cxx.get_id() == 'msvc' ? ['cpp_std=c++17'] : [],
     version: '0.0.0', soversion: '0',
     gnu_symbol_visibility: 'hidden',
     install: true)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]