Merge branch 'master' into yaz-744
authorAdam Dickmeiss <adam@indexdata.dk>
Thu, 27 Feb 2014 09:05:14 +0000 (10:05 +0100)
committerAdam Dickmeiss <adam@indexdata.dk>
Thu, 27 Feb 2014 09:05:14 +0000 (10:05 +0100)
doc/common
include/yaz/yconfig.h
src/init_globals.c
src/log.c
src/record_conv.c

index f2c6ab1..2e8f066 160000 (submodule)
@@ -1 +1 @@
-Subproject commit f2c6ab1772ad4033eb7239d78e6b0905f1fe62de
+Subproject commit 2e8f066e04b29e67bdbe09087d9ad042ca066c00
index 67c203d..ce0d44f 100644 (file)
@@ -57,7 +57,9 @@
 #define YAZ_END_CDECL
 #endif
 
+YAZ_BEGIN_CDECL
 YAZ_EXPORT void yaz_init_globals(void);
+YAZ_END_CDECL
 
 #endif
 /*
index 1f2905c..81cb966 100644 (file)
 #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;
@@ -51,7 +55,10 @@ void yaz_init_globals(void)
             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);
index 265dd77..b439c4c 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -577,6 +577,8 @@ int yaz_log_mask_str(const char *str)
     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;
index 34a3cc3..ca1e41e 100644 (file)
@@ -702,9 +702,6 @@ yaz_record_conv_t yaz_record_conv_create()
     p->wr_error = wrbuf_alloc();
     p->rules = 0;
     p->path = 0;
-#if YAZ_HAVE_EXSLT
-    exsltRegisterAll();
-#endif
     return p;
 }