Commit 6fce4a24 by David 'Digit' Turner Committed by David Turner

[android] Fix build.

A previous CL broke the Android build due to the fact that sw::trace() is only defined by System/Debug.hpp on non-Android platforms (while DebugAndroid.hpp defines trace() instead). Use the TRACE() macro instead of calling the function directly. Bug: b/73656151 Change-Id: I85e9f592a43df8bc4dc719b995934bb9c3bfa97f Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/36329Tested-by: 's avatarDavid Turner <digit@google.com> Kokoro-Presubmit: David Turner <digit@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent adb0d51c
......@@ -67,7 +67,7 @@ bool MemFd::allocate(const char* name, size_t size)
close();
#ifndef __NR_memfd_create
sw::trace("memfd_create() not supported on this system!");
TRACE("memfd_create() not supported on this system!");
return false;
#else
// In the event of no system call this returns -1 with errno set
......@@ -75,13 +75,13 @@ bool MemFd::allocate(const char* name, size_t size)
fd_ = syscall(__NR_memfd_create, name, MFD_CLOEXEC);
if (fd_ < 0)
{
sw::trace("memfd_create() returned %d: %s", errno, strerror(errno));
TRACE("memfd_create() returned %d: %s", errno, strerror(errno));
return false;
}
// Ensure there is enough space.
if (size > 0 && ::ftruncate(fd_, size) < 0)
{
sw::trace("ftruncate() %lld returned %d: %s", (long long)size, errno, strerror(errno));
TRACE("ftruncate() %lld returned %d: %s", (long long)size, errno, strerror(errno));
close();
return false;
}
......@@ -97,7 +97,7 @@ void MemFd::close()
// https://lwn.net/Articles/576478/ for example.
int ret = ::close(fd_);
if (ret < 0) {
sw::trace("MemFd::close() failed with: %s", strerror(errno));
TRACE("MemFd::close() failed with: %s", strerror(errno));
assert(false);
}
fd_ = -1;
......
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