lumiera_documentation/src/common/dummy-func.cpp
Ichthyostega 62922d357b (irrelevant) changes to make the dummy code build and load shared module
Explanation: together with the bare SCons build system, on this branch I added
some dummy codefiles, to validate the build system is working as merged in from master
2008-12-20 03:40:28 +01:00

42 lines
890 B
C++

/*
dummy-func.cpp - placeholder with dummy functions to demonstrate building shared modules
* ******************************************************************************************/
#include "common/dummy-func.hpp"
#include <dlfcn.h>
#include <nobug.h>
namespace lumiera {
const char * const GUI_MODULE_NAME = ".libs/gtk_gui.lum";
typedef void (*VoidFunc)(void);
void
loadDummyGui()
{
void* handle = dlopen (GUI_MODULE_NAME, RTLD_LAZY|RTLD_LOCAL);
if (handle)
{
VoidFunc entryPoint = (VoidFunc) dlsym (handle, "start_dummy_gui");
if (!entryPoint)
ERROR (lumiera, "unable to resolve the entry point symbol after loading the GUI module.");
else
(*entryPoint) ();
}
else
ERROR (lumiera, "unable to load %s", GUI_MODULE_NAME);
}
} // namespace lumiera