1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-09 20:23:51 +03:00

r14603: Fix building of ejs modules as shared libs

Fix calling of ejs_exception() without requiring --export-dynamic
This commit is contained in:
Jelmer Vernooij
2006-03-21 07:08:08 +00:00
committed by Gerald (Jerry) Carter
parent 6cdefd8945
commit 8575e9a490
7 changed files with 25 additions and 12 deletions

View File

@@ -60,7 +60,9 @@ INIT_FUNCTION = smb_setup_ejs_system
#######################
# Start LIBRARY smbcalls
[SUBSYSTEM::smbcalls]
[LIBRARY::smbcalls]
SO_VERSION = 0
VERSION = 0.0.1
PRIVATE_PROTO_HEADER = proto.h
OBJ_FILES = \
smbcalls.o \

View File

@@ -121,15 +121,23 @@ static int ejs_version(MprVarHandle eid, int argc, struct MprVar **argv)
return 0;
}
static void (*ejs_exception_handler) (const char *) = NULL;
_PUBLIC_ void ejs_exception(const char *reason)
{
ejs_exception_handler(reason);
}
/*
setup C functions that be called from ejs
*/
void smb_setup_ejs_functions(void)
void smb_setup_ejs_functions(void (*exception_handler)(const char *))
{
init_module_fn static_init[] = STATIC_smbcalls_MODULES;
init_module_fn *shared_init;
ejs_exception_handler = exception_handler;
smb_setup_ejs_cli();
smb_setup_ejs_options();
smb_setup_ejs_credentials();

View File

@@ -30,7 +30,7 @@
static EjsId eid;
_PUBLIC_ void ejs_exception(const char *reason)
static void smbscript_ejs_exception(const char *reason)
{
Ejs *ep = ejsPtr(eid);
ejsSetErrorMsg(eid, "%s", reason);
@@ -72,7 +72,7 @@ int main(int argc, const char **argv)
exit(127);
}
smb_setup_ejs_functions();
smb_setup_ejs_functions(smbscript_ejs_exception);
if ((eid = ejsOpenEngine(handle, 0)) == (EjsId)-1) {
fprintf(stderr, "smbscript: ejsOpenEngine(): unable to "