Navigation


Changeset 1493:a89913941dcf in freeDiameter


Ignore:
Timestamp:
Mar 30, 2020, 1:31:48 PM (4 years ago)
Author:
Luke Mewburn <luke@mewburn.net>
Branch:
default
Phase:
public
Message:

extensions: hide symbols by default

Hide extension.fdx symbols by default, by setting the
target property <LANG>C_VISIBILITY_PRESET hidden.
This requires cmake 2.8+

Explicitly export fd_ext_init() and fd_ext_fini(),
using gcc or clang's attribute((visibility()))

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/CMakeLists.txt

    r1454 r1493  
    1111  SET_TARGET_PROPERTIES(${EXTNAME} PROPERTIES PREFIX "" )
    1212  SET_TARGET_PROPERTIES(${EXTNAME} PROPERTIES SUFFIX ".fdx" )
     13  SET_TARGET_PROPERTIES(${EXTNAME} PROPERTIES C_VISIBILITY_PRESET hidden )
     14  SET_TARGET_PROPERTIES(${EXTNAME} PROPERTIES CXX_VISIBILITY_PRESET hidden )
    1315ENDMACRO(FD_ADD_EXTENSION)
    1416
  • include/freeDiameter/extension.h

    r994 r1493  
    4949const char *fd_ext_depends[] = { _name , ## _depends , NULL };                          \
    5050static int extension_loaded = 0;                                                        \
     51                                                                                        \
     52__attribute__((visibility("default")))                                                  \
    5153int fd_ext_init(int major, int minor, char * conffile) {                                \
    5254        if ((major != FD_PROJECT_VERSION_MAJOR)                                         \
     
    6466        extension_loaded++;                                                             \
    6567        return (_function)(conffile);                                                   \
    66 }                                                                                                               
     68}
     69
     70/* Optional exit point (finish function) of the extension */
     71__attribute__((visibility("default")))
     72void fd_ext_fini(void);
    6773
    6874#ifdef __cplusplus
Note: See TracChangeset for help on using the changeset viewer.