Path: blob/main/system/lib/llvm-libc/hdr/stdlib_overlay.h
6168 views
//===-- Including stdlib.h in overlay mode --------------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#ifndef LLVM_LIBC_HDR_STDLIB_OVERLAY_H9#define LLVM_LIBC_HDR_STDLIB_OVERLAY_H1011#ifdef LIBC_FULL_BUILD12#error "This header should only be included in overlay mode"13#endif1415// Overlay mode1617// glibc <stdlib.h> header might provide extern inline definitions for few18// functions, causing external alias errors. They are guarded by19// `__USE_FORTIFY_LEVEL`, which will be temporarily disabled.2021#ifdef _FORTIFY_SOURCE22#define LIBC_OLD_FORTIFY_SOURCE _FORTIFY_SOURCE23#undef _FORTIFY_SOURCE24#endif2526#ifdef __USE_FORTIFY_LEVEL27#define LIBC_OLD_USE_FORTIFY_LEVEL __USE_FORTIFY_LEVEL28#undef __USE_FORTIFY_LEVEL29#define __USE_FORTIFY_LEVEL 030#endif3132#include <stdlib.h>3334#ifdef LIBC_OLD_FORTIFY_SOURCE35#define _FORTIFY_SOURCE LIBC_OLD_FORTIFY_SOURCE36#undef LIBC_OLD_FORTIFY_SOURCE37#endif3839#ifdef LIBC_OLD_USE_FORTIFY_LEVEL40#undef __USE_FORTIFY_LEVEL41#define __USE_FORTIFY_LEVEL LIBC_OLD_USE_FORTIFY_LEVEL42#undef LIBC_OLD_USE_FORTIFY_LEVEL43#endif4445#endif464748