diff --git a/include/hiload/hiload.h b/include/hiload/hiload.h index a610cc8..61e010b 100644 --- a/include/hiload/hiload.h +++ b/include/hiload/hiload.h @@ -5,6 +5,9 @@ extern "C" { #endif +// Allows using -fvisibility=hidden by default, decreasing visible symbols +#pragma GCC visibility push(default) + // Return codes for reload_module typedef enum { HI_RELOAD_SUCCESS = 0, @@ -15,11 +18,17 @@ typedef enum { /* Initialiez the module. Must be called before anything else */ int hi_init(); + /* Frees memory and cleans up */ void hi_deinit(); + +/* Print a random assortment of information from current state */ void hi_print_module_infos(); + +/* Reload module identified by the name */ ReloadResult hi_reload_module(const char *module_name); +#pragma GCC visibility pop #ifdef __cplusplus } #endif diff --git a/test/manual/CMakeLists.txt b/test/manual/CMakeLists.txt index 861ca11..9e245f3 100644 --- a/test/manual/CMakeLists.txt +++ b/test/manual/CMakeLists.txt @@ -11,4 +11,11 @@ add_library(mini SHARED ) -target_link_libraries(minimal mini) +# find_library(HILOAD_LIB NAMES hiload PATHS ${CMAKE_BINARY_DIR}) +# if (${HILOAD_LIB} STREQUAL 'HILOAD_LIB-NOTFOUND') +# message(FATAL_ERROR "Couldn't find hiload library") +# endif() + +# target_link_libraries(minimal mini ${HILOAD_LIB}) + +target_link_libraries(minimal mini hiload) diff --git a/test/manual/minimal.cpp b/test/manual/minimal.cpp index 8195b8e..4d9990f 100644 --- a/test/manual/minimal.cpp +++ b/test/manual/minimal.cpp @@ -1,11 +1,16 @@ #include "minimal_lib.h" +// We're not installing anything, so this is a bit weird here +#include "../../include/hiload/hiload.h" + #include #include #include int main(int argc, char *argv[]) { + hi_init(); + int modified = -1; while (modified != 0) { @@ -25,5 +30,7 @@ int main(int argc, char *argv[]) { printf("\n"); } + hi_deinit(); + return 0; }