Retro68/gcc/libsanitizer/interception/interception_type_test.cc

39 lines
1.3 KiB
C++
Raw Normal View History

2014-09-21 17:33:12 +00:00
//===-- interception_type_test.cc -------------------------------*- C++ -*-===//
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file is a part of AddressSanitizer, an address sanity checker.
//
// Compile-time tests of the internal type definitions.
//===----------------------------------------------------------------------===//
#include "interception.h"
2019-06-02 15:48:37 +00:00
#if SANITIZER_LINUX || SANITIZER_MAC
2014-09-21 17:33:12 +00:00
#include <sys/types.h>
#include <stddef.h>
#include <stdint.h>
2015-08-28 15:33:40 +00:00
COMPILER_CHECK(sizeof(::SIZE_T) == sizeof(size_t));
COMPILER_CHECK(sizeof(::SSIZE_T) == sizeof(ssize_t));
COMPILER_CHECK(sizeof(::PTRDIFF_T) == sizeof(ptrdiff_t));
COMPILER_CHECK(sizeof(::INTMAX_T) == sizeof(intmax_t));
2014-09-21 17:33:12 +00:00
2019-06-02 15:48:37 +00:00
#if !SANITIZER_MAC
2015-08-28 15:33:40 +00:00
COMPILER_CHECK(sizeof(::OFF64_T) == sizeof(off64_t));
2014-09-21 17:33:12 +00:00
#endif
// The following are the cases when pread (and friends) is used instead of
// pread64. In those cases we need OFF_T to match off_t. We don't care about the
// rest (they depend on _FILE_OFFSET_BITS setting when building an application).
2019-06-02 15:48:37 +00:00
# if SANITIZER_ANDROID || !defined _FILE_OFFSET_BITS || \
2014-09-21 17:33:12 +00:00
_FILE_OFFSET_BITS != 64
2015-08-28 15:33:40 +00:00
COMPILER_CHECK(sizeof(::OFF_T) == sizeof(off_t));
2014-09-21 17:33:12 +00:00
# endif
#endif