brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · 44ed3d4 Raw
70 lines · c
1//===-- Including uchar.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_UCHAR_OVERLAY_H10#define LLVM_LIBC_HDR_UCHAR_OVERLAY_H11 12#ifdef LIBC_FULL_BUILD13#error "This header should only be included in overlay mode"14#endif15 16// Overlay mode17 18// glibc <uchar.h> header might provide extern inline definitions for few19// functions, causing external alias errors.  They are guarded by20// `__USE_EXTERN_INLINES` macro.  We temporarily disable `__USE_EXTERN_INLINES`21// macro by defining `__NO_INLINE__` before including <uchar.h>.22// And the same with `__USE_FORTIFY_LEVEL`, which will be temporarily disabled23// with `_FORTIFY_SOURCE`.24 25#ifdef _FORTIFY_SOURCE26#define LIBC_OLD_FORTIFY_SOURCE _FORTIFY_SOURCE27#undef _FORTIFY_SOURCE28#endif29 30#ifndef __NO_INLINE__31#define __NO_INLINE__ 132#define LIBC_SET_NO_INLINE33#endif34 35#ifdef __USE_EXTERN_INLINES36#define LIBC_OLD_USE_EXTERN_INLINES37#undef __USE_EXTERN_INLINES38#endif39 40#ifdef __USE_FORTIFY_LEVEL41#define LIBC_OLD_USE_FORTIFY_LEVEL __USE_FORTIFY_LEVEL42#undef __USE_FORTIFY_LEVEL43#define __USE_FORTIFY_LEVEL 044#endif45 46#include <uchar.h>47 48#ifdef LIBC_OLD_FORTIFY_SOURCE49#define _FORTIFY_SOURCE LIBC_OLD_FORTIFY_SOURCE50#undef LIBC_OLD_FORTIFY_SOURCE51#endif52 53#ifdef LIBC_SET_NO_INLINE54#undef __NO_INLINE__55#undef LIBC_SET_NO_INLINE56#endif57 58#ifdef LIBC_OLD_USE_FORTIFY_LEVEL59#undef __USE_FORTIFY_LEVEL60#define __USE_FORTIFY_LEVEL LIBC_OLD_USE_FORTIFY_LEVEL61#undef LIBC_OLD_USE_FORTIFY_LEVEL62#endif63 64#ifdef LIBC_OLD_USE_EXTERN_INLINES65#define __USE_EXTERN_INLINES66#undef LIBC_OLD_USE_EXTERN_INLINES67#endif68 69#endif // LLVM_LIBC_HDR_UCHAR_OVERLAY_H70