pike.git / src / dynamic_load.c

version» Context lines:

pike.git/src/dynamic_load.c:532:    exit = CAST_TO_FUN(dlsym(module, "pike_module_exit"));    if (!exit) {    exit = CAST_TO_FUN(dlsym(module, "_pike_module_exit"));    if (!exit) {    dlclose(module);    Pike_error("pike_module_exit missing in dynamic module \"%S\".\n",    module_name);    }    }    - #if defined(__NT__) && defined(_M_IA64) -  { -  fprintf(stderr, "pike_module_init: 0x%p\n" -  " func: 0x%p\n" -  " gp: 0x%p\n", -  init, ((void **)init)[0], ((void **)init)[1]); -  fprintf(stderr, "pike_module_exit: 0x%p\n" -  " func: 0x%p\n" -  " gp: 0x%p\n", -  exit, ((void **)exit)[0], ((void **)exit)[1]); -  } - #endif /* __NT__ && _M_IA64 */ -  +     new_module=ALLOC_STRUCT(module_list);    new_module->next=dynamic_module_list;    dynamic_module_list=new_module;    new_module->module=module;    copy_shared_string(new_module->name, Pike_sp[-args].u.string);    new_module->module_prog = NULL;    new_module->init=init;    new_module->exit=exit;       enter_compiler(new_module->name, 1);       start_new_program();       global_callable_flags|=CALLABLE_DYNAMIC;      #ifdef PIKE_DEBUG    { struct svalue *save_sp=Pike_sp;   #endif    SET_ONERROR(err, cleanup_compilation, NULL); - #if defined(__NT__) && defined(_M_IA64) -  fprintf(stderr, "Calling pike_module_init()...\n"); - #endif /* __NT__ && _M_IA64 */ +     (*(modfun)init)(); - #if defined(__NT__) && defined(_M_IA64) -  fprintf(stderr, "pike_module_init() done.\n"); - #endif /* __NT__ && _M_IA64 */ +     UNSET_ONERROR(err);   #ifdef PIKE_DEBUG    if(Pike_sp != save_sp)    Pike_fatal("pike_module_init in %s left "    "%"PRINTPTRDIFFT"d droppings on stack.\n",    module_name->str, Pike_sp - save_sp);    }   #endif       pop_n_elems(args);