Commit Graph

37 Commits

Author SHA1 Message Date
Lauro Moura f3199ba04b eolian-cxx: Release iterators
Summary:
When the iterators advanced, the CXX wrappers null'd them but did not
call eina_value_free.

ref T8280

Reviewers: q66, brunobelo, felipealmeida

Reviewed By: q66

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8280

Differential Revision: https://phab.enlightenment.org/D10238
2019-09-30 16:08:24 +02:00
Lauro Moura 03da60997e cxx: Fix some warnings from -Wextra
Summary:
- As we don't have C++17's [[fallthrough]], rely on GCC'd detection
  of fallthrough comments.

  See https://developers.redhat.com/blog/2017/03/10/wimplicit-fallthrough-in-gcc-7/

- Replaced some copy constructors with typecast operators.

  Previously, a constructor with remove_const/remove_cv were used
  to allow const iterators to be constructed from non-const iterators.
  This had the side effect of making these constructors actual copy
  constructors for non const lists. As we did not define other
  special constructors/operators, the rule of 5 were violated for these
  cases.

  This commit replaces these constructors with actual typecast operators
  that promote non const iterators to their const counterparts.

- Cast a Eina_Bool/bool narrowing conversion

- Add a missing break statement from D10050

Reviewers: zmike, brunobelo, felipealmeida

Reviewed By: brunobelo

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9934
2019-09-23 13:58:01 -03:00
Mike Blumenkrantz 9dc7643f93 Revert "cxx: Fix some warnings from -Wextra"
This reverts commit bdb8505f3b.

more review pending on this
2019-09-16 14:19:43 -04:00
Lauro Moura bdb8505f3b cxx: Fix some warnings from -Wextra
Summary:
- As we don't have C++17's [[fallthrough]], rely on GCC'd detection
  of fallthrough comments.

See https://developers.redhat.com/blog/2017/03/10/wimplicit-fallthrough-in-gcc-7/

- Add some missing copy assignment operators as reported by
  -Wdeprecated-copy

- Cast a Eina_Bool/bool narrowing conversion

Reviewers: zmike, brunobelo, felipealmeida

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9934
2019-09-16 12:41:37 -04:00
Vitor Sousa b1e44484a5 cxx: remove compilation warnings in C++ code, from both gcc and clang
Summary:
Remove almost all the compilation warnings from C++ code. Only explicit
warnings using the `#warning` preprocessor directive remain.

Some warnings had to be suppressed with `#pragma` directives because the
behavior they were warning about is intended in some specific places.
Code comments were added in such situations.

Added a generator that creates `#pragma` directives in order to suppress
warnings in all generated C++ headers.
Currently `-Wignored-qualifiers` is the only warning category being suppressed.
The innocuous const qualifiers that it points are inoffensive and have
no effect in compilation at all.
They are also hard to track in generation since they can emerge from different
types in many places.

To ease the generation of the warning suppressors an utility constructor was
added to `efl::eolian::grammar::attributes::unused_type`.

Add constructors to `eolian_mono::class_context` to default initialize its
internal string and avoid field initialization warnings.

Test Plan: `meson test`

Reviewers: lauromoura, felipealmeida, zmike, segfaultxavi

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl_language_bindings

Differential Revision: https://phab.enlightenment.org/D9275
2019-07-12 09:07:27 -04:00
Marcel Hollerbach e881f936e8 meson: unbreak cxx header installation
Summary:
before we had *correct* fileds in the subdir: keyword. However,
install_dir: was wrong, so *this* time, this seems right.

Reviewers: cedric, zmike, segfaultxavi, raster

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8634
2019-04-18 12:30:22 -04:00
Felipe Magno de Almeida f392c5a436 efl-mono: Add support for dotnet core
Summary:
This commits adds dotnet as a supported C# platform for EFL# bindings.

Due to differences between Mono and Dotnet regarding DllImport, the
bindings now are using an imperative approach to load the function
pointers through the NativeModule and FunctionWrapper classes. These
classes handle the dlopen/LoadLibrary and dlsym/GetProcAddress calls.

Also, the previous caching of non-owned strings returned to native code
was removed until further memory checks.

We also had to create workaround for bool and chars in Structs for C#
marshaling. Going through System.Byte instead and Marshaling manually
to their respective types.

In order to actually build efl_mono.dll with dotnet right now,
issue #4782 from Meson should be fixed to make it properly detect and
used the Dotnet compiler. Also use "-Ddotnet=true" when running meson.

Fixes T7394

Reviewers: felipealmeida, vitor.sousa, bu5hm4n

Reviewed By: vitor.sousa

Subscribers: cedric

Tags: #efl

Maniphest Tasks: T7394

Differential Revision: https://phab.enlightenment.org/D8069
2019-03-01 23:58:56 -03:00
Cedric BAIL 40ca3fbe58 eina_cxx: allow for the generation of function that return Eina_Promise in .eo files.
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D7576
2019-01-16 14:33:24 -08:00
Marcel Hollerbach e85311c992 meson: here comes cxx bindings
this commits is bringing cxx bindings.
You can enable / disable them with the cxx option.

Differential Revision: https://phab.enlightenment.org/D7181
2018-10-24 12:05:58 +02:00
Marcel Hollerbach 52e0b8440b Revert "meson: add cxx bindings"
This reverts commit 5aaf2cbb5d.

The cxx bindings were accidently merged. Things are missing (like .eot.h
files)
2018-10-18 16:12:13 +02:00
Marcel Hollerbach 5aaf2cbb5d meson: add cxx bindings
this commit adds cxx bindings to meson.

Differential Revision: https://phab.enlightenment.org/D7169
2018-10-18 16:01:07 +02:00
Lauro Moura 946b47430d eina_cxx: Fix eina::value copy constructor.
Summary:
The previous declaration was causing the implicit copy constructor to be
invoked when copying a new eina::value from an existing eina::value,
thus leading to two wrappers pointing to the same underlying C pointer.

This showed some error messages when running the tests but under autotools
it didn't fail, while building with meson caused it to segfault.

Reviewers: vitor.sousa

Reviewed By: vitor.sousa

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7166
2018-10-16 18:47:20 -03:00
Lauro Moura f1fddf5c74 cxx: Remove libeolian_cxx dependency on eo_cxx
Summary: Fixes T7324

Reviewers: felipealmeida, bu5hm4n, zmike

Reviewed By: felipealmeida, bu5hm4n, zmike

Subscribers: segfaultxavi, cedric, #reviewers, #committers, zmike

Tags: #efl

Maniphest Tasks: T7324

Differential Revision: https://phab.enlightenment.org/D6881
2018-08-21 14:21:43 -04:00
Jean-Philippe Andre 488c29febd cxx: Add FIXME note in eina_value.hh
I think some concepts are not handled properly in this set of classes.
I'll do some more experiments to see if I can find a working solution,
but I think we need 3 variants of eina_value, instead of just the two
provided.
2017-12-05 10:09:58 +09:00
Jean-Philippe Andre cfb3365060 cxx: Add strbuf support
Comes in two fashions:
 - strbuf_view (read-only)
 - strbuf (read/write)
2017-12-05 10:09:58 +09:00
Jean-Philippe Andre 58527a3dbb cxx: Fix log color in eina_log.hh
Changed from invalid "black" to arbitrary choice of green.
2017-11-07 09:57:24 +09:00
Felipe Magno de Almeida 1cfc96dd5b eo-cxx: Fix ompilation error for uncomplete Eina_Future type 2017-09-06 17:03:36 +09:00
Felipe Magno de Almeida ae822a396c eina-cxx: Add visit_unsafe to eina::variant and make ~variant possibly noexcept
visit_unsafe member function visits the variant but assumes the
pre-condition that the variant is not empty. This avoids the
possibility of throwing an exception when the destructors
of the types used in variant are also guaranteed to be
noexcept.

CID 1367508
2016-12-20 15:33:57 -03:00
Felipe Magno de Almeida 3704173017 eina-cxx: Add move constructor and move assignment operator for eina::variant
CID 1362797
2016-12-20 15:26:35 -03:00
Felipe Magno de Almeida 137dd4864d eina-cxx: eolian-cxx: Fix correct usage of is_eolian_object traits 2016-11-03 17:59:20 -02:00
Felipe Magno de Almeida 17da4b5b9d eo-cxx: Fix compilation and warnings in clang 2016-10-20 04:52:18 -02:00
Felipe Magno de Almeida 88419e5e87 eina-cxx: Implement aligned_union for GCC 4.9 2016-09-22 19:27:56 -03:00
Felipe Magno de Almeida e0b444f95f eo-cxx: Add race promises through eina::variant 2016-09-14 00:33:22 -03:00
Felipe Magno de Almeida dbed78ad3b eina-cxx: Moved variant to eina C++ 2016-09-14 00:33:22 -03:00
Felipe Magno de Almeida a63cfcafc7 eolian-cxx: Implement future template class for C++ 2016-09-11 23:44:05 -03:00
Felipe Magno de Almeida f8a6568d5c eolian-cxx: Fix compilation break with Eo rename to EFL 2016-08-15 15:14:53 -03:00
Felipe Magno de Almeida 1c402f62a9 eolian-cxx: Fix generation for ref generic_values and Eolian classes 2016-07-05 16:32:11 -03:00
Felipe Magno de Almeida 512fb7f39b eina-cxx: Add overload for std::nullptr_t to stringview 2016-06-15 15:50:04 -03:00
Felipe Magno de Almeida 8906998ef2 eolian-cxx: Add support for ref parameters and correct ownership handling 2016-06-14 22:44:02 -03:00
Felipe Magno de Almeida 4d1b3191d9 eina-cxx: Add placeholder for futures in C++ binding 2016-06-06 02:50:36 -03:00
Felipe Magno de Almeida 710f97580a eina-cxx: Fix wrongful operator++ for iterator and docs 2016-06-06 02:50:13 -03:00
Felipe Magno de Almeida 7e1ce2d33d eina-cxx: Add c_str() to string_view 2016-06-06 02:49:47 -03:00
Felipe Magno de Almeida fec589cbdc eina-cxx: Restrict templated constructor 2016-06-06 02:49:28 -03:00
Felipe Magno de Almeida a1f2d03ecb eina-cxx: Add optional specialization for pointer types 2016-06-06 02:49:00 -03:00
Felipe Magno de Almeida 396fd5e3e1 eina-cxx: Added crange_array template typedef 2016-05-26 16:46:23 -03:00
Felipe Magno de Almeida 6e23780bb1 eolian-cxx: Fix generation of complex types in C++ binding
Fixed generation of complex types in C++ binding, with tests. This
problem came after the removal of the pointer types for top-level
complex types.
2016-05-23 17:34:50 -03:00
Felipe Magno de Almeida e3c8b280c6 c++: Reorganized C++ binding generation
Moved all generation to a single Makefile_Cxx.am file instead of
throughout the whole project. And fixed C++ generation on Elementary
after elm merge.
2016-05-23 15:05:50 -03:00