Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=fvbe.git;a=commitdiff;h=a3114cfc896229d74ef296fb1f7e7e6610fc4fc7
commit a3114cfc896229d74ef296fb1f7e7e6610fc4fc7 Author: James Buren <[email protected]> Date: Mon Apr 28 08:36:24 2014 -0500 incorporate C functions for setting up UI after dlopen diff --git a/src-new/ui_newt.cpp b/src-new/ui_newt.cpp index e806f78..ff3a40b 100644 --- a/src-new/ui_newt.cpp +++ b/src-new/ui_newt.cpp @@ -2,7 +2,8 @@ #include <cstdlib> #include <csignal> #include <unistd.h> -#include "newt.hpp" +#include "main.hpp" +#include "ui_newt.hpp" int UINewt::main(int argc, char **argv) { @@ -37,3 +38,28 @@ int UINewt::main(int argc, char **argv) return code; } + +extern "C" UI *ui_new() +{ + UINewt *ui = new UINewt(); + + return dynamic_cast <UI *> (ui); +} + +extern "C" void ui_delete(UI *p) +{ + UINewt *ui = dynamic_cast <UINewt *> (p); + + delete ui; +} + +#ifndef NDEBUG +static void test_shared_exports() __attribute__((unused)); + +static void test_shared_exports() +{ + // Force compiler to validate the exported C functions. + __attribute__((unused)) ui_new_t a = ui_new; + __attribute__((unused)) ui_delete_t b = ui_delete; +} +#endif diff --git a/src-new/ui_newt.hpp b/src-new/ui_newt.hpp index 45c929c..c3240bb 100644 --- a/src-new/ui_newt.hpp +++ b/src-new/ui_newt.hpp @@ -3,7 +3,7 @@ #include <newt.h> #include "ui.hpp" -class UINewt : UI +class UINewt : public UI { public: int main(int argc, char **argv); _______________________________________________ Frugalware-git mailing list [email protected] http://frugalware.org/mailman/listinfo/frugalware-git
