[gjs/arg-inlines: 5/11] arg: Add GIArgument setter overload for char32_t



commit 1232bfaae625a41cd088d236d18a8d2f992ce6c3
Author: Philip Chimento <philip chimento gmail com>
Date:   Fri Jul 10 23:03:00 2020 -0700

    arg: Add GIArgument setter overload for char32_t
    
    This provides a semantic difference between gunichar and uint32_t.

 gi/arg-inl.h | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/gi/arg-inl.h b/gi/arg-inl.h
index 5e5d411c..0430fc3a 100644
--- a/gi/arg-inl.h
+++ b/gi/arg-inl.h
@@ -88,6 +88,12 @@ GJS_USE inline decltype(auto) gjs_g_argument_value<uint64_t>(GIArgument* arg) {
     return gjs_g_argument_value(arg, &GIArgument::v_uint64);
 }
 
+// gunichar is stored in v_uint32
+template <>
+GJS_USE inline decltype(auto) gjs_g_argument_value<char32_t>(GIArgument* arg) {
+    return gjs_g_argument_value(arg, &GIArgument::v_uint32);
+}
+
 template <>
 GJS_USE inline decltype(auto) gjs_g_argument_value<GType, GI_TYPE_TAG_GTYPE>(
     GIArgument* arg) {


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