brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · 17ae78b Raw
48 lines · c
1//===-- Including fcntl.h in overlay mode ---------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9#ifndef LLVM_LIBC_HDR_FCNTL_OVERLAY_H10#define LLVM_LIBC_HDR_FCNTL_OVERLAY_H11 12#ifdef LIBC_FULL_BUILD13#error "This header should only be included in overlay mode"14#endif15 16// Overlay mode17 18// glibc <fcntl.h> header might provide extern inline definitions for few19// functions, causing external alias errors.  They are guarded by20// `__USE_FORTIFY_LEVEL`, which will be temporarily disabled21// with `_FORTIFY_SOURCE`.22 23#ifdef _FORTIFY_SOURCE24#define LIBC_OLD_FORTIFY_SOURCE _FORTIFY_SOURCE25#undef _FORTIFY_SOURCE26#endif27 28#ifdef __USE_FORTIFY_LEVEL29#define LIBC_OLD_USE_FORTIFY_LEVEL __USE_FORTIFY_LEVEL30#undef __USE_FORTIFY_LEVEL31#define __USE_FORTIFY_LEVEL 032#endif33 34#include <fcntl.h>35 36#ifdef LIBC_OLD_FORTIFY_SOURCE37#define _FORTIFY_SOURCE LIBC_OLD_FORTIFY_SOURCE38#undef LIBC_OLD_FORTIFY_SOURCE39#endif40 41#ifdef LIBC_OLD_USE_FORTIFY_LEVEL42#undef __USE_FORTIFY_LEVEL43#define __USE_FORTIFY_LEVEL LIBC_OLD_USE_FORTIFY_LEVEL44#undef LIBC_OLD_USE_FORTIFY_LEVEL45#endif46 47#endif // LLVM_LIBC_HDR_FCNTL_OVERLAY_H48