zmike pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=ee7f843834e1aeb9d27cea8ef92c48758e56fcc9

commit ee7f843834e1aeb9d27cea8ef92c48758e56fcc9
Author: Lauro Moura <lauromo...@expertisesolutions.com.br>
Date:   Mon Mar 11 11:34:45 2019 -0400

    cxx: Fix examples compilation.
    
    Summary:
    - Changed beta methods guards from CLASS_NAME_GUARD to
      EFL_BETA_API_SUPPORT to use the same scheme as C.
    - Removed some includes to Efl_Ui.h from the examples. These were
      causing C's efl_part_get to not be generated due to EFL_PART_PROTECTED
      not being yet defined (it is defined in Elementary.hh, included
      afterwards). This was leading to Efl.Part.impl.hh trying to use a
      non-existent method.
    
    Fixes T7716 partially (missing stringshare issue)
    
    Test Plan: make examples
    
    Reviewers: stefan_schmidt, felipealmeida, zmike
    
    Reviewed By: zmike
    
    Subscribers: cedric, #reviewers, #committers
    
    Tags: #efl
    
    Maniphest Tasks: T7716
    
    Differential Revision: https://phab.enlightenment.org/D8284
---
 src/examples/elementary/bg_cxx_example_01.cc        | 1 +
 src/examples/elementary/bg_cxx_example_02.cc        | 1 +
 src/examples/elementary/button_cxx_example_00.cc    | 1 +
 src/examples/elementary/button_cxx_example_01.cc    | 2 +-
 src/examples/elementary/radio_cxx_example_01.cc     | 2 +-
 src/examples/elementary/slider_cxx_example.cc       | 3 +--
 src/examples/elementary/toolbar_cxx_example_01.cc   | 2 +-
 src/lib/eolian_cxx/grammar/function_declaration.hpp | 4 ++--
 src/lib/eolian_cxx/grammar/function_definition.hpp  | 4 ++--
 9 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/src/examples/elementary/bg_cxx_example_01.cc 
b/src/examples/elementary/bg_cxx_example_01.cc
index 7e0724c3ca..5919d18531 100644
--- a/src/examples/elementary/bg_cxx_example_01.cc
+++ b/src/examples/elementary/bg_cxx_example_01.cc
@@ -1,4 +1,5 @@
 #define EFL_CXXPERIMENTAL // for background part
+#define EFL_BETA_API_SUPPORT
 #include <Elementary.hh>
 
 using efl::eo::instantiate;
diff --git a/src/examples/elementary/bg_cxx_example_02.cc 
b/src/examples/elementary/bg_cxx_example_02.cc
index 94c17e3dcf..f88329d2eb 100644
--- a/src/examples/elementary/bg_cxx_example_02.cc
+++ b/src/examples/elementary/bg_cxx_example_02.cc
@@ -6,6 +6,7 @@
  */
 
 #define EFL_CXXPERIMENTAL
+#define EFL_BETA_API_SUPPORT
 
 #include <Elementary.hh>
 
diff --git a/src/examples/elementary/button_cxx_example_00.cc 
b/src/examples/elementary/button_cxx_example_00.cc
index d44f18a924..a0cdb1c566 100644
--- a/src/examples/elementary/button_cxx_example_00.cc
+++ b/src/examples/elementary/button_cxx_example_00.cc
@@ -1,6 +1,7 @@
 // g++ -g `pkg-config --cflags --libs elementary-cxx efl-cxx eina-cxx eo-cxx 
ecore-cxx evas-cxx edje-cxx` button_cxx_example_00.cc -o button_cxx_example_00
 
 #define EFL_CXXPERIMENTAL
+#define EFL_BETA_API_SUPPORT
 #include <Elementary.hh>
 #include <iostream>
 
diff --git a/src/examples/elementary/button_cxx_example_01.cc 
b/src/examples/elementary/button_cxx_example_01.cc
index c818897fbb..3136f6ac04 100644
--- a/src/examples/elementary/button_cxx_example_01.cc
+++ b/src/examples/elementary/button_cxx_example_01.cc
@@ -1,7 +1,7 @@
 // g++ -g `pkg-config --cflags --libs elementary-cxx efl-cxx eina-cxx eo-cxx 
ecore-cxx evas-cxx edje-cxx` button_cxx_example_01.cc -o button_cxx_example_01
 
 #define EFL_CXXPERIMENTAL
-#include <Efl_Ui.h>
+#define EFL_BETA_API_SUPPORT
 #include <Elementary.hh>
 
 using efl::eo::instantiate;
diff --git a/src/examples/elementary/radio_cxx_example_01.cc 
b/src/examples/elementary/radio_cxx_example_01.cc
index 2ad30b2097..e72fe9f55e 100644
--- a/src/examples/elementary/radio_cxx_example_01.cc
+++ b/src/examples/elementary/radio_cxx_example_01.cc
@@ -1,7 +1,7 @@
 // g++ -g `pkg-config --cflags --libs elementary-cxx efl-cxx eina-cxx eo-cxx 
ecore-cxx evas-cxx edje-cxx` radio_cxx_example_01.cc -o radio_cxx_example_01
 
 #define EFL_CXXPERIMENTAL
-#include <Efl_Ui.h>
+#define EFL_BETA_API_SUPPORT
 #include <Elementary.hh>
 #include <iostream>
 
diff --git a/src/examples/elementary/slider_cxx_example.cc 
b/src/examples/elementary/slider_cxx_example.cc
index 1df1903bf5..82846257cf 100644
--- a/src/examples/elementary/slider_cxx_example.cc
+++ b/src/examples/elementary/slider_cxx_example.cc
@@ -1,8 +1,7 @@
 // g++ -g `pkg-config --cflags --libs elementary-cxx efl-cxx eina-cxx eo-cxx 
ecore-cxx evas-cxx edje-cxx` slider_cxx_example.cc -o slider_cxx_example
 
 #define EFL_CXXPERIMENTAL
-
-#include <Efl_Ui.h>
+#define EFL_BETA_API_SUPPORT
 #include <Elementary.hh>
 
 using namespace std::placeholders;
diff --git a/src/examples/elementary/toolbar_cxx_example_01.cc 
b/src/examples/elementary/toolbar_cxx_example_01.cc
index 77ad3eb569..6f4e83be89 100644
--- a/src/examples/elementary/toolbar_cxx_example_01.cc
+++ b/src/examples/elementary/toolbar_cxx_example_01.cc
@@ -7,7 +7,7 @@
 
 #warning This example requires yet unfinished EO APIs
 
-#include <Efl_Ui.h>
+#define EFL_BETA_API_SUPPORT
 #include <Elementary.hh>
 
 EAPI int
diff --git a/src/lib/eolian_cxx/grammar/function_declaration.hpp 
b/src/lib/eolian_cxx/grammar/function_declaration.hpp
index dc6a969a58..1ae63df857 100644
--- a/src/lib/eolian_cxx/grammar/function_declaration.hpp
+++ b/src/lib/eolian_cxx/grammar/function_declaration.hpp
@@ -44,8 +44,8 @@ struct function_declaration_generator
         }
 
       if(f.is_beta &&
-            !as_generator("#ifdef " << *(string << "_") << string << "_BETA\n")
-            .generate(sink, std::make_tuple(_klass_name.namespaces, 
_klass_name.eolian_name), add_upper_case_context(ctx)))
+            !as_generator(lit("#ifdef EFL_BETA_API_SUPPORT\n"))
+            .generate(sink, attributes::unused, ctx))
         return false;
       if(f.is_protected &&
             !as_generator("#ifdef " << *(string << "_") << string << 
"_PROTECTED\n")
diff --git a/src/lib/eolian_cxx/grammar/function_definition.hpp 
b/src/lib/eolian_cxx/grammar/function_definition.hpp
index 893218155c..c5de8ce531 100644
--- a/src/lib/eolian_cxx/grammar/function_definition.hpp
+++ b/src/lib/eolian_cxx/grammar/function_definition.hpp
@@ -50,8 +50,8 @@ struct function_definition_generator
         }
       
       if(f.is_beta &&
-         !as_generator("#ifdef " << *(string << "_") << string << "_BETA\n")
-         .generate(sink, std::make_tuple(_klass_name.namespaces, 
_klass_name.eolian_name), add_upper_case_context(ctx)))
+         !as_generator(lit("#ifdef EFL_BETA_API_SUPPORT\n"))
+         .generate(sink, attributes::unused, ctx))
         return false;
       if(f.is_protected &&
          !as_generator("#ifdef " << *(string << "_") << string << 
"_PROTECTED\n")

-- 


Reply via email to