[prev in list] [next in list] [prev in thread] [next in thread] 

List:       enlightenment-devel
Subject:    Re: [E-devel] [EGIT] [core/efl] master 01/01: eolian-cxx: Fix compilation errors with new any_value_
From:       Daniel Kolesa <daniel () octaforge ! org>
Date:       2017-09-26 13:50:28
Message-ID: 1506433828.1224727.1118746088.1CBE2CC3 () webmail ! messagingengine ! com
[Download RAW message or body]

On Tue, Sep 26, 2017, at 03:00, Felipe Magno de Almeida wrote:
> felipealmeida pushed a commit to branch master.
> 
> http://git.enlightenment.org/core/efl.git/commit/?id=bb887f9869c3dd9eca72c8e65f335d148f9dbdd3
> 
> commit bb887f9869c3dd9eca72c8e65f335d148f9dbdd3
> Author: Felipe Magno de Almeida <felipe@expertisesolutions.com.br>
> Date:   Mon Sep 25 21:57:25 2017 -0300
> 
>     eolian-cxx: Fix compilation errors with new any_value_ptr and mstring
>     types
> ---

cool, thanks

>  src/bindings/cxx/eo_cxx/eo_cxx_interop.hh          |  6 +++++-
>  src/lib/eolian_cxx/grammar/type_impl.hpp           | 25
>  ++++++++++++++++++++++
>  src/tests/eolian_cxx/name1_name2_type_generation.c |  4 ++--
>  3 files changed, 32 insertions(+), 3 deletions(-)
> 
> diff --git a/src/bindings/cxx/eo_cxx/eo_cxx_interop.hh
> b/src/bindings/cxx/eo_cxx/eo_cxx_interop.hh
> index d5f31d351c..2f9b6382b3 100644
> --- a/src/bindings/cxx/eo_cxx/eo_cxx_interop.hh
> +++ b/src/bindings/cxx/eo_cxx/eo_cxx_interop.hh
> @@ -394,7 +394,11 @@ inline char* convert_to_c_impl(
> ::efl::eina::string_view v, tag<char*, ::efl::ei
>    std::strcpy(string, v.c_str());
>    return string;
>  }
> -inline char** convert_to_c_impl(efl::eina::string_view* /*view*/,
> tag<char **, efl::eina::string_view*>)
> +inline char** convert_to_c_impl(efl::eina::string_view& /*view*/,
> tag<char **, efl::eina::string_view, true>)
> +{
> +  std::abort();
> +}
> +inline const char** convert_to_c_impl(efl::eina::string_view& /*view*/,
> tag<const char **, efl::eina::string_view, true>)
>  {
>    std::abort();
>  }
> diff --git a/src/lib/eolian_cxx/grammar/type_impl.hpp
> b/src/lib/eolian_cxx/grammar/type_impl.hpp
> index bb61980dd9..fb78c1e51b 100644
> --- a/src/lib/eolian_cxx/grammar/type_impl.hpp
> +++ b/src/lib/eolian_cxx/grammar/type_impl.hpp
> @@ -110,6 +110,24 @@ struct visitor_generate
>                  r.base_qualifier.qualifier ^= qualifier_info::is_ref;
>                  return replace_base_type(r, "
>                  ::efl::eina::string_view");
>                }}
> +           , {"mstring", false, nullptr, nullptr, [&]
> +              {
> +                regular_type_def r = regular;
> +                r.base_qualifier.qualifier |= qualifier_info::is_ref;
> +                // r.base_qualifier.qualifier ^=
> qualifier_info::is_const;
> +                if(is_out || is_return)
> +                  return replace_base_type(r, " ::std::string");
> +                return replace_base_type(r, "
> ::efl::eina::string_view");
> +              }}
> +           , {"mstring", true, nullptr, nullptr, [&]
> +              {
> +                regular_type_def r = regular;
> +                r.base_qualifier.qualifier ^= qualifier_info::is_ref;
> +                // r.base_qualifier.qualifier ^=
> qualifier_info::is_const;
> +                if(is_out || is_return)
> +                  return replace_base_type(r, " ::std::string");
> +                return replace_base_type(r, "
> ::efl::eina::string_view");
> +              }}
>             , {"stringshare", nullptr, nullptr, nullptr, [&]
>                {
>                  regular_type_def r = regular;
> @@ -124,6 +142,13 @@ struct visitor_generate
>             , {"any_value", false, nullptr, nullptr, [&]
>                { return regular_type_def{" ::efl::eina::value_view",
>                regular.base_qualifier, {}};
>                }}
> +           , {"any_value_ptr", true, nullptr, nullptr, [&]
> +              {
> +                return regular_type_def{" ::efl::eina::value",
> regular.base_qualifier ^ qualifier_info::is_ref, {}};
> +              }}
> +           , {"any_value_ptr", false, nullptr, nullptr, [&]
> +              { return regular_type_def{" ::efl::eina::value_view",
> regular.base_qualifier ^ qualifier_info::is_ref, {}};
> +              }}
>          };
>        if(regular.base_type == "void_ptr")
>          {
> diff --git a/src/tests/eolian_cxx/name1_name2_type_generation.c
> b/src/tests/eolian_cxx/name1_name2_type_generation.c
> index 26dc899d5c..2517bcdd85 100644
> --- a/src/tests/eolian_cxx/name1_name2_type_generation.c
> +++ b/src/tests/eolian_cxx/name1_name2_type_generation.c
> @@ -102,7 +102,7 @@ void _name1_name2_type_generation_instringshareown(Eo
> *obj EINA_UNUSED, Type_Gen
>    eina_stringshare_del(v);
>  }
>  
> -void _name1_name2_type_generation_instringptrown(Eo *obj EINA_UNUSED,
> Type_Generation_Data *pd EINA_UNUSED, char * *v)
> +void _name1_name2_type_generation_instringptrown(Eo *obj EINA_UNUSED,
> Type_Generation_Data *pd EINA_UNUSED, const char * *v)
>  {
>    ck_assert_str_eq(*v, "foobar");
>    free((void*)*v);
> @@ -197,7 +197,7 @@ char *
> _name1_name2_type_generation_returnstringown(Eo *obj EINA_UNUSED, Type_Ge
>    return p;
>  }
>  
> -char * * _name1_name2_type_generation_returnstringownptr(Eo *obj
> EINA_UNUSED, Type_Generation_Data *pd EINA_UNUSED)
> +const char * * _name1_name2_type_generation_returnstringownptr(Eo *obj
> EINA_UNUSED, Type_Generation_Data *pd EINA_UNUSED)
>  {
>    const char foobar[] = "foobar";
>    char** p1 = malloc(sizeof(const char*));
> 
> -- 
> 
> 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic