summaryrefslogtreecommitdiff
path: root/absl/base
diff options
context:
space:
mode:
authorGravatar Abseil Team <absl-team@google.com>2023-06-29 12:58:39 -0700
committerGravatar Copybara-Service <copybara-worker@google.com>2023-06-29 12:59:30 -0700
commit4eaff9e61e173079bcac644db18f5536cec12d8b (patch)
tree8edd0196ad53c1a7d1d2806b9919d09f32b04a14 /absl/base
parent9402bd32fbb24f762f7923ece6afe131a5b57f35 (diff)
Support Qualcomm Hexagon DSP targets.
PiperOrigin-RevId: 544438364 Change-Id: I22d461f2d0aa8638a0e640eebecdc7e5e2b49ea3
Diffstat (limited to 'absl/base')
-rw-r--r--absl/base/config.h2
-rw-r--r--absl/base/internal/sysinfo.cc8
-rw-r--r--absl/base/internal/thread_identity.cc2
3 files changed, 10 insertions, 2 deletions
diff --git a/absl/base/config.h b/absl/base/config.h
index 6d38d3f4..e6c9d0c2 100644
--- a/absl/base/config.h
+++ b/absl/base/config.h
@@ -487,6 +487,8 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
#elif defined(__Fuchsia__)
// Signals don't exist on fuchsia.
#elif defined(__native_client__)
+// Signals don't exist on hexagon/QuRT
+#elif defined(__hexagon__)
#else
// other standard libraries
#define ABSL_HAVE_ALARM 1
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.