summaryrefslogtreecommitdiff
path: root/src/dynlib.h
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2015-11-23 18:48:42 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2015-11-23 19:01:51 -0800
commitda8c7ca2647d2e111a415f59c6b59053a19bdb61 (patch)
tree04dd13e37031bbee8b6ff6c0365db28b846c5a5c /src/dynlib.h
parentceaca7bec6adf5735d51c1ca7efea5a2e05f470e (diff)
downloademacs-da8c7ca2647d2e111a415f59c6b59053a19bdb61.tar.gz
Port better to FreeBSD’s dlfunc vs dlsym
This avoids warnings when converting between void * and function pointers, which strict C11 does not allow. * configure.ac (dlfunc): Check for existence. * src/dynlib.c (dlfunc) [!HAVE_DLFUNC]: New macro. (dynlib_func): New function. * src/dynlib.h (dynlib_function_ptr, dynlib_func): New decls. * src/emacs-module.c (Fmodule_load): Use dynlib_func, not dynlib_sym, for function pointers.
Diffstat (limited to 'src/dynlib.h')
-rw-r--r--src/dynlib.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/dynlib.h b/src/dynlib.h
index 1282c4fd719..1c19b5db8ac 100644
--- a/src/dynlib.h
+++ b/src/dynlib.h
@@ -25,6 +25,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
typedef void *dynlib_handle_ptr;
dynlib_handle_ptr dynlib_open (const char *path);
void *dynlib_sym (dynlib_handle_ptr h, const char *sym);
+typedef struct dynlib_function_ptr_nonce *(*dynlib_function_ptr) (void);
+dynlib_function_ptr dynlib_func (dynlib_handle_ptr h, const char *sym);
bool dynlib_addr (void *ptr, const char **path, const char **sym);
const char *dynlib_error (void);
int dynlib_close (dynlib_handle_ptr h);