From 4eaff9e61e173079bcac644db18f5536cec12d8b Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Thu, 29 Jun 2023 12:58:39 -0700 Subject: Support Qualcomm Hexagon DSP targets. PiperOrigin-RevId: 544438364 Change-Id: I22d461f2d0aa8638a0e640eebecdc7e5e2b49ea3 --- absl/base/internal/sysinfo.cc | 8 +++++++- absl/base/internal/thread_identity.cc | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'absl/base/internal') diff --git a/absl/base/internal/sysinfo.cc b/absl/base/internal/sysinfo.cc index 605a11eb..8bcc4faf 100644 --- a/absl/base/internal/sysinfo.cc +++ b/absl/base/internal/sysinfo.cc @@ -190,7 +190,13 @@ static double GetNominalCPUFrequency() { // and the memory location pointed to by value is set to the value read. static bool ReadLongFromFile(const char *file, long *value) { bool ret = false; - int fd = open(file, O_RDONLY | O_CLOEXEC); +#if defined(_POSIX_C_SOURCE) + const int file_mode = (O_RDONLY | O_CLOEXEC); +#else + const int file_mode = O_RDONLY; +#endif + + int fd = open(file, file_mode); if (fd != -1) { char line[1024]; char *err; diff --git a/absl/base/internal/thread_identity.cc b/absl/base/internal/thread_identity.cc index 0eeb7d00..252443eb 100644 --- a/absl/base/internal/thread_identity.cc +++ b/absl/base/internal/thread_identity.cc @@ -80,7 +80,7 @@ void SetCurrentThreadIdentity(ThreadIdentity* identity, absl::call_once(init_thread_identity_key_once, AllocateThreadIdentityKey, reclaimer); -#if defined(__EMSCRIPTEN__) || defined(__MINGW32__) +#if defined(__EMSCRIPTEN__) || defined(__MINGW32__) || defined(__hexagon__) // Emscripten and MinGW pthread implementations does not support signals. // See https://kripken.github.io/emscripten-site/docs/porting/pthreads.html // for more information. -- cgit v1.2.3