Commit Graph

118 Commits

Author SHA1 Message Date
电线杆
ad725d34cc Use std::getenv #3414 (#3415) 2025-06-08 23:16:34 +03:00
Gabi Melman
7e022c4300 Feature 3379 (#3397)
* Fix #3379

* clang format
2025-05-08 14:02:00 +03:00
Gabi Melman
9c58257480 Fix zformatter on Apple and POSIX.1-2024 conforming platform (#3366)
* Add test case for #3351 (wrong GMT offset in SunOS/Solaris fallback)

* Fix #3352 (Missing test for Apple / POSIX.1-2024 chooses buggy workaround)

Apple platforms have had the tm_gmtoff-field at least since Mac OS X 10.0,
as are POSIX.1-2024 conforming systems, which are also required to support
it.

This has the unfortunate effect to use the SunOS/Solaris fallback, which
doesn't compute the correct value if the passed value of tm isn't the
current system time, i.e. localtime(::time()) (#3351).

* Fixed GMT offset test

---------

Co-authored-by: toh <toh@ableton.com>
2025-03-29 13:44:11 +03:00
Gabi Melman
1e6250e183 Gabime/fwrite unlocked (#3276)
* Use locking fwrite_unlocked if possible

* Added compile definitions to header_only
2024-12-01 14:16:52 +02:00
captainurist
5673e9e545 utf8_to_wstrbuf now handles invalid utf8 sequences (#3244) 2024-11-05 22:54:01 +02:00
gabime
22b0f4fc06 Clang format 2024-04-30 12:28:13 +03:00
gabime
94a8e87c71 Fix #3079 2024-04-29 19:46:59 +03:00
Tomas-Zhu
73e2e02b42 Fix #3038 (#3044)
* Fix #3038

* Fix #3038 again

---------

Co-authored-by: Tomas-Zhu <z773922114@gmail.com>
2024-03-21 12:16:11 +02:00
liubing
8979f7fb2a Also use _stat() on Windows to be more UTF8 friendly (#2978)
* Also use _stat() on Windows to be more UTF8 friendly

* Cosmetic changes
2024-01-13 23:46:18 +02:00
Peter Nemeth
479a5ac3f1 Fix OS availability check of pthread_threadid_np for iOS (#2897) 2023-10-11 10:34:42 +03:00
gabime
0a53eafe18 update clang format again 2023-09-25 16:40:36 +03:00
gabime
9d52261185 clang format 2023-09-25 16:08:29 +03:00
gabime
95c226e9c9 format 2023-09-25 05:05:25 +03:00
Gabi Melman
5931a3d6f8 Fixed windows compile 2023-09-25 04:58:45 +03:00
gabime
1a0bfc7a89 clang format 2023-09-25 02:44:07 +03:00
gabime
1f61f5e019 clang format 2023-06-07 13:23:44 +03:00
Sergey Fedorov
c65aa4e488 os-inl.h: fix for missing pthread_threadid_np (#2715) 2023-04-23 11:09:41 +03:00
Gabi Melman
262acfdeb5 Update os-inl.h 2023-02-25 19:52:27 +02:00
Gabi Melman
a4d8817745 move include cassert 2023-02-25 17:30:39 +02:00
Gabi Melman
66407f5b48 Better handling of utf to wchar 2023-02-25 17:02:50 +02:00
Gabi Melman
78e86ba01f Update os-inl.h 2023-01-15 15:59:41 +02:00
espkk
f29f369a12 Add sync to file_helper (#2343) 2023-01-15 15:33:40 +02:00
Ivan Grokhotkov
85a009ad64 Support newlib C library configurations without tm_gmtoff field (#2600)
Newlib C library (https://sourceware.org/newlib/) has a configuration
option to add tm_gmtoff field to the tm structure. Not all the
platforms supported by newlib enable this option, and spdlog doesn't
compile on such platforms due to missing tm_gmtoff field.

Fix this by checking for `__NEWLIB__` and `__TM_GMTOFF` and enabling
calculate_gmt_offset.
2023-01-10 00:12:03 +01:00
Khem Raj
287a00d364 Do not use LFS64 functions on linux/musl (#2589)
On musl, off_t is 64bit always ( even on 32bit platforms ), therefore
using LFS64 funcitons is not needed on such platforms. Moreover, musl
has stopped providing aliases for these functions [1] which means it
wont compile on newer musl systems. Therefore only use it on 32bit
glibc/linux platforms and exclude musl like cygwin or OSX

[1] https://git.musl-libc.org/cgit/musl/commit/?id=246f1c811448f37a44b41cd8df8d0ef9736d95f4
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-01-03 19:54:50 +02:00
Charles Milette
cd4f6c1466 Replace fmt_helper::to_string by a macro 2022-04-26 23:25:35 -04:00
Charles Milette
37dd6bb159 Address PR review comments 2022-04-25 21:59:56 -04:00
Charles Milette
714cf12822 Add fmt_helper.h include to includes.h and os-inl.h 2022-04-22 23:28:28 -04:00
Charles Milette
ebeb3707b1 Switch to vformat_to
Drive-by: reduce the amount of occurences of #ifdef SPDLOG_USE_STD_FORMAT
2022-04-21 21:59:02 -04:00
Andrey Bugaevskiy
5ee969e4f6 Fix fopen_s error reporting with PREVENT_CHILD_FD 2022-03-11 19:22:45 +00:00
Vladislav Nepogodin
f096c615c3 🔥 conditional_cast 2021-12-19 21:37:21 +04:00
Vladislav Nepogodin
f81cb9f365 Revert "Useless cast"
This reverts commit 7e95963940.
2021-12-19 21:05:21 +04:00
Vladislav Nepogodin
7e95963940 Useless cast 2021-12-19 15:04:47 +04:00
Acretock
9e17fafe1b c style cast -> static_cast 2021-12-11 16:29:10 +02:00
semenov_gv
e3e4c4bc95 minor changes added const ref params 2021-12-11 16:09:19 +02:00
lisr
232df72b82 use pthread_getthrds_np for AIX 2021-11-20 09:48:14 +08:00
lisr
aac187d3a0 fix aix compile error 2021-11-19 10:55:43 +08:00
gabime
dc030ec53c clang-format 2021-11-16 23:44:35 +02:00
Charles Milette
5d6af189f1 Use target.capacity() even with std::string 2021-11-16 09:59:48 -05:00
Charless Milette
44a4517e2b Support C++20 std::format as an alternative to fmtlib 2021-11-13 11:29:05 -05:00
gabime
e7e8b75a4c clang-format 2021-07-19 00:50:51 +03:00
zyw1995ted@163.com
37372960a8 add a color-terminal type 2021-06-28 18:12:12 +08:00
LE GARREC Vincent
ec8763adf2 Fix signed/unsigned mismatch in VS 2021-06-13 19:35:02 +02:00
Vadim Zeitlin
ff5221b693 Fix warning about testing _WIN64 which might be undefined
This warning is disabled by default, but is pretty useful and worth
enabling for MSVC, just as -Wundef for gcc, so fix it in Win32 build.
2021-05-06 22:33:41 +01:00
Vadim Zeitlin
6442963f49 Avoid harmless warning about unreachable statement in MSVS build
All MSVS versions >= 2015 warn about "return 0" after throw_spdlog_ex()
being unreachable in filesize(), so disable this warning in this
function (note that it can't be disabled inside it).
2021-05-06 22:02:25 +01:00
Unknown
7e9385405f better numeric_limits<>::max/min fix when using SPDLOG_WCHAR_TO_UTF8_SUPPORT
NOMINMAX macro doesn't work everytime for some reason
2021-02-06 10:50:29 +02:00
Charles Milette
ac35dd5a6f Prevent integer overflows in wstr_to_utf8buf and utf8_to_wstrbuf 2021-01-10 18:26:24 -05:00
Charles Milette
fc594b551a Prevent win_eventlog_sink from silently discarding errors when wide support is enabled 2021-01-06 22:17:09 -05:00
Charles Milette
a453bccff0 Better support for / separators on Windows, improve wchar filename coverage 2021-01-06 04:15:14 -05:00
dominic
cec365888a Added check for COLORTERM environment variable to detect if terminal
supports color.
Added alacritty to supported color terminals.
2020-12-19 23:22:31 +01:00
Amir Alperin
7fff900a1a Fix error message in exception 2020-12-16 06:57:24 +02:00