-Subproject commit f2c6ab1772ad4033eb7239d78e6b0905f1fe62de
+Subproject commit 2e8f066e04b29e67bdbe09087d9ad042ca066c00
#define YAZ_END_CDECL
#endif
+YAZ_BEGIN_CDECL
YAZ_EXPORT void yaz_init_globals(void);
+YAZ_END_CDECL
#endif
/*
#include <gcrypt.h>
#endif
+#if YAZ_HAVE_EXSLT
+#include <libexslt/exslt.h>
+#endif
+
static int yaz_init_flag = 0;
#if YAZ_POSIX_THREADS
static pthread_mutex_t yaz_init_mutex = PTHREAD_MUTEX_INITIALIZER;
gcry_control(GCRYCTL_INITIALIZATION_FINISHED, NULL, 0);
}
#endif
- yaz_init_flag = 1;
+#if YAZ_HAVE_EXSLT
+ exsltRegisterAll();
+#endif
+ yaz_init_flag = 1; /* must be last, before unlocking */
}
#if YAZ_POSIX_THREADS
pthread_mutex_unlock(&yaz_init_mutex);
return yaz_log_mask_str_x(str, l_level);
}
+/* this function is called by yaz_log_init_globals & yaz_init_globals
+ and, thus, may not call any of them indirectly */
int yaz_log_mask_str_x(const char *str, int level)
{
const char *p;
p->wr_error = wrbuf_alloc();
p->rules = 0;
p->path = 0;
-#if YAZ_HAVE_EXSLT
- exsltRegisterAll();
-#endif
return p;
}