diagnostic-show-locus.c: remove unused field from class colorizer
[official-gcc.git] / libsanitizer / sanitizer_common / sanitizer_syscall_generic.inc
blob3bc50d972a4c432523e3899764d83f74efd5bb75
1 //===-- sanitizer_syscall_generic.inc ---------------------------*- C++ -*-===//
2 //
3 // This file is distributed under the University of Illinois Open Source
4 // License. See LICENSE.TXT for details.
5 //
6 //===----------------------------------------------------------------------===//
7 //
8 // Generic implementations of internal_syscall and internal_iserror.
9 //
10 //===----------------------------------------------------------------------===//
12 #if SANITIZER_FREEBSD || SANITIZER_MAC
13 # define SYSCALL(name) SYS_ ## name
14 #else
15 # define SYSCALL(name) __NR_ ## name
16 #endif
18 #if (SANITIZER_FREEBSD || SANITIZER_MAC) && defined(__x86_64__)
19 # define internal_syscall __syscall
20 # else
21 # define internal_syscall syscall
22 #endif
24 bool internal_iserror(uptr retval, int *rverrno) {
25   if (retval == (uptr)-1) {
26     if (rverrno)
27       *rverrno = errno;
28     return true;
29   } else {
30     return false;
31   }