Define iconv conversions as thread safe varialbe instead of static.

Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Klaas Freitag 2013-03-12 17:19:07 +01:00 committed by Andreas Schneider
parent 72dddfd7f5
commit f5c9458079
3 changed files with 9 additions and 9 deletions

View file

@ -47,14 +47,6 @@
#include "vio/csync_vio_method.h"
#include "csync_macros.h"
#if defined(__GNUC__)
# define CSYNC_THREAD __thread
#elif defined(_MSC_VER)
# define CSYNC_THREAD __declspec(thread)
#else
# define CSYNC_THREAD
#endif
/**
* How deep to scan directories.
*/

View file

@ -121,6 +121,14 @@ int c_setup_iconv(const char* to);
int c_close_iconv(void);
#endif
#if defined(__GNUC__)
# define CSYNC_THREAD __thread
#elif defined(_MSC_VER)
# define CSYNC_THREAD __declspec(thread)
#else
# define CSYNC_THREAD
#endif
#endif //_C_PRIVATE_H
/* vim: set ft=c.doxygen ts=8 sw=2 et cindent: */

View file

@ -48,7 +48,7 @@ typedef struct {
iconv_t from;
} iconv_conversions;
static iconv_conversions _iconvs = { NULL, NULL };
CSYNC_THREAD iconv_conversions _iconvs = { NULL, NULL };
int c_setup_iconv(const char* to) {
_iconvs.to = iconv_open(to, "UTF-8");