diff options
author | thegeorg <thegeorg@yandex-team.com> | 2022-07-15 18:27:02 +0300 |
---|---|---|
committer | thegeorg <thegeorg@yandex-team.com> | 2022-07-15 18:27:02 +0300 |
commit | 0a78ab3e043a2e93bc7f428a93013d8f05e9bc84 (patch) | |
tree | b7347519d5568ca3ae837712909c1a2466666306 | |
parent | 33372610945489b6d181d8d89e195fd698945425 (diff) | |
download | ydb-0a78ab3e043a2e93bc7f428a93013d8f05e9bc84.tar.gz |
Fix compiling jwt-cpp on Darwin
Нашёл локальный для Маркета фикс и вынес в код самого контриба.
-rw-r--r-- | contrib/libs/jwt-cpp/picojson/picojson.h | 4 | ||||
-rw-r--r-- | library/cpp/yt/threading/rw_spin_lock.h | 8 |
2 files changed, 9 insertions, 3 deletions
diff --git a/contrib/libs/jwt-cpp/picojson/picojson.h b/contrib/libs/jwt-cpp/picojson/picojson.h index 2fe0e4485f..b5b38017b5 100644 --- a/contrib/libs/jwt-cpp/picojson/picojson.h +++ b/contrib/libs/jwt-cpp/picojson/picojson.h @@ -487,7 +487,11 @@ inline std::string value::to_str() const { #ifdef PICOJSON_USE_INT64 case int64_type: { char buf[sizeof("-9223372036854775808")]; +#if defined(__APPLE__) + SNPRINTF(buf, sizeof(buf), "%lld" PRId64, u_.int64_); +#else SNPRINTF(buf, sizeof(buf), "%" PRId64, u_.int64_); +#endif return buf; } #endif diff --git a/library/cpp/yt/threading/rw_spin_lock.h b/library/cpp/yt/threading/rw_spin_lock.h index ed1e178730..3e834dfcc9 100644 --- a/library/cpp/yt/threading/rw_spin_lock.h +++ b/library/cpp/yt/threading/rw_spin_lock.h @@ -27,15 +27,17 @@ public: * Optimized for the case of read-intensive workloads. * Cheap (just one atomic increment and no spinning if no writers are present). * Don't use this call if forks are possible: forking at some - * intermediate point inside #AcquireReader may leave the lock - * forever stuck for the child process. + * intermediate point inside #AcquireReader may corrupt the lock state and + * leave lock forever stuck for the child process. */ void AcquireReader() noexcept; //! Acquires the reader lock. /*! * A more expensive version of #AcquireReader (includes at least * one atomic load and CAS; also may spin even if just readers are present). - * In contrast to #AcquireReader, this call is safe to use in presence of forks. + * In contrast to #AcquireReader, this method can be used in the presence of forks. + * Note that fork-friendliness alone does not provide fork-safety: additional + * actions must be performed to release the lock after a fork. */ void AcquireReaderForkFriendly() noexcept; //! Tries acquiring the reader lock; see #AcquireReader. |