Commit 4eaff9e6 by Abseil Team Committed by Copybara-Service

Support Qualcomm Hexagon DSP targets.

PiperOrigin-RevId: 544438364
Change-Id: I22d461f2d0aa8638a0e640eebecdc7e5e2b49ea3
parent 9402bd32
......@@ -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
......
......@@ -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;
......
......@@ -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.
......
......@@ -34,7 +34,7 @@
#if defined(__ELF__) && !defined(__OpenBSD__) && !defined(__QNX__) && \
!defined(__native_client__) && !defined(__asmjs__) && \
!defined(__wasm__) && !defined(__HAIKU__) && !defined(__sun) && \
!defined(__VXWORKS__)
!defined(__VXWORKS__) && !defined(__hexagon__)
#define ABSL_HAVE_ELF_MEM_IMAGE 1
#endif
......
......@@ -23,7 +23,7 @@
#ifndef ABSL_LOG_INTERNAL_CONDITIONS_H_
#define ABSL_LOG_INTERNAL_CONDITIONS_H_
#ifdef _WIN32
#if defined(_WIN32) || defined(__hexagon__)
#include <cstdlib>
#else
#include <unistd.h>
......
......@@ -102,7 +102,9 @@ class NullStreamMaybeFatal final : public NullStream {
explicit NullStreamMaybeFatal(absl::LogSeverity severity)
: fatal_(severity == absl::LogSeverity::kFatal) {}
~NullStreamMaybeFatal() {
if (fatal_) _exit(1);
if (fatal_) {
_exit(1);
}
}
private:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment