File tree Expand file tree Collapse file tree 10 files changed +24
-11
lines changed
Expand file tree Collapse file tree 10 files changed +24
-11
lines changed Original file line number Diff line number Diff line change 143143 (!defined (_WIN32) || \
144144 (defined (__clang__) && __clang_major__ >= 9 && \
145145 !defined (ABSL_BUILD_DLL) && !defined (ABSL_CONSUME_DLL))) && \
146- !defined (__MINGW32__)
146+ !defined (__MINGW32__) && ! defined (__CYGWIN__)
147147#undef ABSL_ATTRIBUTE_WEAK
148148#define ABSL_ATTRIBUTE_WEAK __attribute__ ((weak))
149149#define ABSL_HAVE_ATTRIBUTE_WEAK 1
Original file line number Diff line number Diff line change @@ -377,7 +377,8 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
377377 defined(__asmjs__) || defined(__EMSCRIPTEN__) || defined(__Fuchsia__) || \
378378 defined(__sun) || defined(__myriad2__) || defined(__HAIKU__) || \
379379 defined(__OpenBSD__) || defined(__NetBSD__) || defined(__QNX__) || \
380- defined(__VXWORKS__) || defined(__hexagon__) || defined(__XTENSA__)
380+ defined(__VXWORKS__) || defined(__hexagon__) || defined(__XTENSA__) || \
381+ defined(__CYGWIN__)
381382#define ABSL_HAVE_MMAP 1
382383#endif
383384
Original file line number Diff line number Diff line change 3636// LowLevelAlloc.
3737#ifdef ABSL_LOW_LEVEL_ALLOC_MISSING
3838#error ABSL_LOW_LEVEL_ALLOC_MISSING cannot be directly set
39- #elif !defined(ABSL_HAVE_MMAP) && !defined(_WIN32)
39+ #elif !defined(ABSL_HAVE_MMAP) && !defined(_WIN32) && !defined(__CYGWIN__)
4040#define ABSL_LOW_LEVEL_ALLOC_MISSING 1
4141#endif
4242
4747#ifdef ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING
4848#error ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING cannot be directly set
4949#elif defined(_WIN32) || defined(__asmjs__) || defined(__wasm__) || \
50- defined (__hexagon__)
50+ defined (__hexagon__) || defined(__CYGWIN__)
5151#define ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING 1
5252#endif
5353
Original file line number Diff line number Diff line change 4444#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \
4545 defined (__hexagon__) || defined(__Fuchsia__) || \
4646 defined(__native_client__) || defined(__OpenBSD__) || \
47- defined(__EMSCRIPTEN__) || defined(__ASYLO__)
47+ defined(__EMSCRIPTEN__) || defined(__ASYLO__) || \
48+ defined(__CYGWIN__)
4849
4950#include < unistd.h>
5051
Original file line number Diff line number Diff line change @@ -481,7 +481,7 @@ pid_t GetTID() {
481481pid_t GetTID () {
482482 // `pthread_t` need not be arithmetic per POSIX; platforms where it isn't
483483 // should be handled above.
484- return static_cast <pid_t >(pthread_self ());
484+ return reinterpret_cast <pid_t >(pthread_self ());
485485}
486486
487487#endif
Original file line number Diff line number Diff line change @@ -57,6 +57,9 @@ int NumCPUs();
5757// return types of GetProcessId() and GetThreadId() are both DWORD, an unsigned
5858// 32-bit type.
5959using pid_t = uint32_t ;
60+ #elif defined(__CYGWIN__)
61+ // On CYGWIN, this works on both i686 (deprecated) and x64 targets.
62+ using pid_t = uintptr_t ;
6063#endif
6164pid_t GetTID ();
6265
Original file line number Diff line number Diff line change 3838// Operating System Check
3939// -----------------------------------------------------------------------------
4040
41- #if defined(__CYGWIN__ )
42- #error "Cygwin is not supported."
43- #endif
44-
4541// -----------------------------------------------------------------------------
4642// Toolchain Check
4743// -----------------------------------------------------------------------------
Original file line number Diff line number Diff line change @@ -34,6 +34,11 @@ namespace log_internal {
3434
3535#ifdef _WIN32
3636using Tid = uint32_t ;
37+ #elif defined(__CYGWIN__)
38+ // Cygwin's GetTID() returns reinterpret_cast<uintptr_t>(pthread_self()),
39+ // which is an 8-byte pointer on x86_64. System pid_t is int (4 bytes)
40+ // and would truncate the thread ID, causing collisions in log output.
41+ using Tid = uint64_t ;
3742#else
3843using Tid = pid_t ;
3944#endif
Original file line number Diff line number Diff line change @@ -170,7 +170,7 @@ class StrippingTest : public ::testing::Test {
170170 // Opens this program's executable file. Returns `nullptr` and writes to
171171 // `stderr` on failure.
172172 std::unique_ptr<FILE, std::function<void (FILE*)>> OpenTestExecutable () {
173- #if defined(__linux__)
173+ #if defined(__linux__) || defined(__CYGWIN__)
174174 std::unique_ptr<FILE, std::function<void (FILE*)>> fp (
175175 fopen (" /proc/self/exe" , " rb" ), [](FILE* fp) { fclose (fp); });
176176 if (!fp) {
Original file line number Diff line number Diff line change 3131#ifdef _MSC_FULL_VER
3232#define ABSL_COMPILER_DOES_EXACT_ROUNDING 0
3333#define ABSL_STRTOD_HANDLES_NAN_CORRECTLY 0
34+ #elif defined(__CYGWIN__)
35+ #define ABSL_COMPILER_DOES_EXACT_ROUNDING 1
36+ // Cygwin's strtod() handles NaN payloads differently for large or
37+ // non-numeric n-char-sequences (e.g., "abc123", very long digit strings).
38+ // The NaN payload encoding is unspecified per IEEE 754, so this is a
39+ // platform difference, not a bug.
40+ #define ABSL_STRTOD_HANDLES_NAN_CORRECTLY 0
3441#else
3542#define ABSL_COMPILER_DOES_EXACT_ROUNDING 1
3643#define ABSL_STRTOD_HANDLES_NAN_CORRECTLY 1
You can’t perform that action at this time.
0 commit comments