mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-29 00:26:33 +03:00
Define iconv conversions as thread safe varialbe instead of static.
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
parent
72dddfd7f5
commit
f5c9458079
3 changed files with 9 additions and 9 deletions
|
@ -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.
|
||||
*/
|
||||
|
|
|
@ -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: */
|
||||
|
|
|
@ -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");
|
||||
|
|
Loading…
Reference in a new issue