diff --git a/3party/jansson/src/error.c b/3party/jansson/src/error.c index 074a68e098..a7c8cbb9e5 100644 --- a/3party/jansson/src/error.c +++ b/3party/jansson/src/error.c @@ -18,10 +18,12 @@ void jsonp_error_init(json_error_t *error, const char *source) void jsonp_error_set_source(json_error_t *error, const char *source) { + size_t length; + if(!error || !source) return; - size_t length = strlen(source); + length = strlen(source); if(length < JSON_ERROR_SOURCE_LENGTH) strcpy(error->source, source); else { diff --git a/3party/jansson/src/hashtable.c b/3party/jansson/src/hashtable.c index 4f0bf8b641..db06dba89f 100644 --- a/3party/jansson/src/hashtable.c +++ b/3party/jansson/src/hashtable.c @@ -16,6 +16,10 @@ typedef struct hashtable_bucket bucket_t; #define list_to_pair(list_) container_of(list_, pair_t, list) +#if defined(_MSC_VER) && !defined(__cplusplus) + #define inline __inline +#endif + static inline void list_init(list_t *list) { list->next = list; diff --git a/3party/jansson/src/jansson.h b/3party/jansson/src/jansson.h index 5cecdf474c..b272bc4404 100644 --- a/3party/jansson/src/jansson.h +++ b/3party/jansson/src/jansson.h @@ -14,6 +14,10 @@ //#include +#if defined(_MSC_VER) && !defined(__cplusplus) + #define inline __inline +#endif + #ifdef __cplusplus extern "C" { #endif @@ -242,4 +246,8 @@ void json_set_alloc_funcs(json_malloc_t malloc_fn, json_free_t free_fn); } #endif +#if defined(_MSC_VER) && !defined(__cplusplus) + #undef inline +#endif + #endif diff --git a/3party/jansson/src/value.c b/3party/jansson/src/value.c index 544c8911df..0766c1e1a3 100644 --- a/3party/jansson/src/value.c +++ b/3party/jansson/src/value.c @@ -16,6 +16,9 @@ #include "jansson_private.h" #include "utf.h" +#if defined(_MSC_VER) && !defined(__cplusplus) + #define inline __inline +#endif static inline void json_init(json_t *json, json_type type) { diff --git a/words/sloynik_index.hpp b/words/sloynik_index.hpp index f0fa9d5a98..c6696a79a8 100644 --- a/words/sloynik_index.hpp +++ b/words/sloynik_index.hpp @@ -15,6 +15,10 @@ class Writer; namespace sl { + namespace impl + { // needed for friend declaration + template struct LessRefProxy; + } // Sorted index of keys. // Two locale-aware comparators are used: primary and secondary. @@ -62,7 +66,7 @@ private: uint8_t m_Lo, m_Mi, m_Hi; }; #pragma pack(pop) - friend class LessRefProxy; + template friend struct impl::LessRefProxy; typedef DDVector DDVectorType;