Add visibility pragma to hiload library header.

Add hiload to minimal
This commit is contained in:
2025-03-18 14:43:07 +02:00
parent 97c5ff206a
commit d75dd85209
3 changed files with 24 additions and 1 deletions

View File

@@ -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

View File

@@ -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)

View File

@@ -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 <chrono>
#include <cstdio>
#include <thread>
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;
}