/* Support macros for making weak and strong aliases for symbols,
and for using symbol sets and linker warnings with GNU ld.
Copyright (C) 1995-2022 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
#ifndef _LIBC_SYMBOLS_H
#define _LIBC_SYMBOLS_H 1
/* This file is included implicitly in the compilation of every source file,
using -include. It includes config.h. */
/* Enable declarations of GNU extensions, since we are compiling them. */
#define _GNU_SOURCE 1
#ifdef MODULE_NAME
/* Use `#if IS_IN (module)` to detect what component is being compiled. */
#define PASTE_NAME1(a,b) a##b
#define PASTE_NAME(a,b) PASTE_NAME1 (a,b)
#define IN_MODULE PASTE_NAME (MODULE_, MODULE_NAME)
#define IS_IN(lib) (IN_MODULE == MODULE_##lib)
/* True if the current module is a versioned library. Versioned
library names culled from shlib-versions files are assigned a
MODULE_* value greater than MODULE_LIBS_BEGIN. */
#define IS_IN_LIB (IN_MODULE > MODULE_LIBS_BEGIN)
/* The testsuite, and some other ancillary code, should be compiled against
as close an approximation to the installed headers as possible.
Defining this symbol disables most internal-use-only declarations
provided by this header, and all those provided by other internal
wrapper headers. */
#if IS_IN (testsuite) || defined IS_IN_build || defined __cplusplus
# define _ISOMAC 1
#endif
#else
/* The generation process for a few files created very early in the
build (notably libc-modules.h itself) involves preprocessing this
header without defining MODULE_NAME. Under these conditions,
internal declarations (especially from config.h) must be visible,
but IS_IN should always evaluate as false. */
# define IS_IN(lib) 0
# define IS_IN_LIB 0
# define IN_MODULE (-1)
#endif
#ifndef _ISOMAC
/* This is defined for the compilation of all C library code. features.h
tests this to avoid inclusion of stubs.h while compiling the library,
before stubs.h has been generated. Some library code that is shared
with other packages also tests this symbol to see if it is being
compiled as part of the C library. We must define this before including
config.h, because it makes some definitions conditional on whether libc
itself is being compiled, or just some generator program. */
#define _LIBC 1
/* Some files must be compiled with optimization on. */
#if !defined __ASSEMBLER__ && !defined __OPTIMIZE__
# error "glibc cannot be compiled without optimization"
#endif
/* -ffast-math cannot be applied to the C library, as it alters the ABI.
Some test components that use -ffast-math are currently not part of
IS_IN (testsuite) for technical reasons, so we have a secondary override. */
#if defined __FAST_MATH__ && !defined TEST_FAST_MATH
# error "glibc must not be compiled with -ffast-math"
#endif
#include <config.h>
/* Obtain the definition of symbol_version_reference. */
#include <libc-symver.h>
/* When PIC is defined and SHARED isn't defined, we are building PIE
by default. */
#if defined PIC && !defined SHARED
# define BUILD_PIE_DEFAULT 1
#else
# define BUILD_PIE_DEFAULT 0
#endif
/* Define this for the benefit of portable GNU code that wants to check it.
Code that checks with