Add visibility pragma to hiload library header.
Add hiload to minimal
This commit is contained in:
@@ -5,6 +5,9 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Allows using -fvisibility=hidden by default, decreasing visible symbols
|
||||||
|
#pragma GCC visibility push(default)
|
||||||
|
|
||||||
// Return codes for reload_module
|
// Return codes for reload_module
|
||||||
typedef enum {
|
typedef enum {
|
||||||
HI_RELOAD_SUCCESS = 0,
|
HI_RELOAD_SUCCESS = 0,
|
||||||
@@ -15,11 +18,17 @@ typedef enum {
|
|||||||
|
|
||||||
/* Initialiez the module. Must be called before anything else */
|
/* Initialiez the module. Must be called before anything else */
|
||||||
int hi_init();
|
int hi_init();
|
||||||
|
|
||||||
/* Frees memory and cleans up */
|
/* Frees memory and cleans up */
|
||||||
void hi_deinit();
|
void hi_deinit();
|
||||||
|
|
||||||
|
/* Print a random assortment of information from current state */
|
||||||
void hi_print_module_infos();
|
void hi_print_module_infos();
|
||||||
|
|
||||||
|
/* Reload module identified by the name */
|
||||||
ReloadResult hi_reload_module(const char *module_name);
|
ReloadResult hi_reload_module(const char *module_name);
|
||||||
|
|
||||||
|
#pragma GCC visibility pop
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
@@ -1,11 +1,16 @@
|
|||||||
#include "minimal_lib.h"
|
#include "minimal_lib.h"
|
||||||
|
|
||||||
|
// We're not installing anything, so this is a bit weird here
|
||||||
|
#include "../../include/hiload/hiload.h"
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
|
|
||||||
|
hi_init();
|
||||||
|
|
||||||
int modified = -1;
|
int modified = -1;
|
||||||
while (modified != 0) {
|
while (modified != 0) {
|
||||||
|
|
||||||
@@ -25,5 +30,7 @@ int main(int argc, char *argv[]) {
|
|||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hi_deinit();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user