Reduce header complexity

- Remove most __ASSEMBLER__ __LINKER__ ifdefs
- Rename libc/intrin/bits.h to libc/serialize.h
- Block pthread cancelation in fchmodat() polyfill
- Remove `clang-format off` statements in third_party
This commit is contained in:
Justine Tunney 2023-11-28 14:24:28 -08:00
parent 96f979dfc5
commit fa20edc44d
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
3057 changed files with 410 additions and 4398 deletions

View file

@ -1,4 +1,3 @@
/* clang-format off */
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
/* Memory allocation on the stack.

View file

@ -20,7 +20,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
#include "third_party/make/dep.h"
#include "third_party/make/filedef.h"
#include "third_party/musl/fnmatch.h"
/* clang-format off */
/* Return nonzero if NAME is an archive-member reference, zero if not. An
archive-member reference is a name like 'lib(member)' where member is a

View file

@ -16,7 +16,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
#include "libc/sysv/consts/o.h"
#include "third_party/make/makeint.inc"
/* clang-format off */
#ifdef TEST
/* Hack, the real error() routine eventually pulls in die from main.c */

View file

@ -1,4 +1,3 @@
/* clang-format off */
/* basename.c -- return the last element in a file name
Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2020 Free Software
@ -21,7 +20,6 @@
/**/
#include "libc/str/str.h"
#include "third_party/make/dirname.h"
/* clang-format off */
/* Return the address of the last file name component of NAME. If
NAME has no relative file name components because it is a file

View file

@ -24,7 +24,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
#include "libc/runtime/runtime.h"
#include "libc/sysv/consts/sig.h"
#include "third_party/make/commands.h"
/* clang-format off */
#define FILE_LIST_SEPARATOR ' '

View file

@ -1,4 +1,3 @@
/* clang-format off */
/* Definition of data structures describing shell commands for GNU Make.
Copyright (C) 1988-2020 Free Software Foundation, Inc.
This file is part of GNU Make.

View file

@ -21,7 +21,6 @@
#include "third_party/make/concat-filename.h"
#include "third_party/make/filename.h"
#include "third_party/make/config.h"
/* clang-format off */
/* Concatenate a directory filename, a relative filename and an optional
suffix. The directory may end with the directory separator. The second

View file

@ -1,4 +1,3 @@
/* clang-format off */
/* Construct a full filename from a directory and a relative filename.
Copyright (C) 2001-2004, 2007-2020 Free Software Foundation, Inc.

View file

@ -1,4 +1,3 @@
/* clang-format off */
/* Debugging macros and interface.
Copyright (C) 1999-2020 Free Software Foundation, Inc.
This file is part of GNU Make.

View file

@ -14,7 +14,6 @@ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */
/* clang-format off */
#include "third_party/make/makeint.inc"
/**/
#include "third_party/make/filedef.h"

View file

@ -1,4 +1,3 @@
/* clang-format off */
/* Definitions of dependency data structures for GNU Make.
Copyright (C) 1988-2020 Free Software Foundation, Inc.
This file is part of GNU Make.

View file

@ -22,7 +22,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
#include "third_party/make/filedef.h"
#include "third_party/make/hash.h"
#include "third_party/musl/glob.h"
/* clang-format off */
#ifndef __ptr_t
#define __ptr_t void *

View file

@ -1,4 +1,3 @@
/* clang-format off */
/* dirname.c -- return all but the last element in a file name
Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2020 Free Software
@ -22,7 +21,6 @@
#include "libc/mem/mem.h"
#include "libc/str/str.h"
#include "third_party/make/dirname.h"
/* clang-format off */
/* Return the length of the prefix of FILE that will be used by
dir_name. If FILE is in the working directory, this returns zero

View file

@ -16,7 +16,6 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* clang-format off */
#ifndef DIRNAME_H_
# define DIRNAME_H_ 1

View file

@ -1,4 +1,3 @@
/* clang-format off */
/* Error handler for noninteractive utilities
Copyright (C) 1990-1998, 2000-2007, 2009-2020 Free Software Foundation, Inc.
This file is part of the GNU C Library.

View file

@ -1,4 +1,3 @@
/* clang-format off */
/* Declaration for error-reporting function
Copyright (C) 1995-1997, 2003, 2006, 2008-2020 Free Software Foundation,
Inc.

View file

@ -1,4 +1,3 @@
/* clang-format off */
/* Failure exit status
Copyright (C) 2002-2003, 2005-2007, 2009-2020 Free Software Foundation, Inc.

View file

@ -1,4 +1,3 @@
/* clang-format off */
/* Failure exit status
Copyright (C) 2002, 2009-2020 Free Software Foundation, Inc.

View file

@ -14,7 +14,6 @@ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */
/* clang-format off */
#include "third_party/make/makeint.inc"
/**/
#include "third_party/make/filedef.h"

View file

@ -1,4 +1,3 @@
/* clang-format off */
/* Provide file descriptor control.
Copyright (C) 2009-2020 Free Software Foundation, Inc.

View file

@ -1,4 +1,3 @@
/* clang-format off */
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
/* Like <fcntl.h>, but with non-working flags defined to 0.

View file

@ -1,5 +1,3 @@
/* clang-format off */
/* clang-format off */
/* Hook for making file descriptor functions close(), ioctl() extensible.
Copyright (C) 2009-2020 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2009.

View file

@ -1,4 +1,3 @@
/* clang-format off */
/* Hook for making file descriptor functions close(), ioctl() extensible.
Copyright (C) 2009-2020 Free Software Foundation, Inc.

View file

@ -14,7 +14,6 @@ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */
/* clang-format off */
#include "third_party/make/makeint.inc"
/**/
#include "third_party/make/filedef.h"

View file

@ -19,7 +19,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
All of these are chained together through 'next'. */
#include "third_party/make/hash.h"
/* clang-format off */
struct commands;
struct dep;

View file

@ -1,4 +1,3 @@
/* clang-format off */
/* Basic filename support macros.
Copyright (C) 2001-2004, 2007-2020 Free Software Foundation, Inc.

View file

@ -1,4 +1,3 @@
/* clang-format off */
/* Locating a program in a given path.
Copyright (C) 2001-2004, 2006-2020 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001, 2019.

View file

@ -1,4 +1,3 @@
/* clang-format off */
/* Locating a program in PATH.
Copyright (C) 2001-2003, 2009-2020 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.

View file

@ -14,7 +14,6 @@ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */
/* clang-format off */
#include "third_party/make/makeint.inc"
/**/
#include "third_party/make/filedef.h"

View file

@ -22,7 +22,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
#include "libc/stdio/stdio.h"
#include "libc/str/str.h"
/* clang-format off */
/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
Ditto for AIX 3.2 and <stdlib.h>. */

View file

@ -16,7 +16,6 @@ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */
/* clang-format off */
#ifndef _GETOPT_H
#define _GETOPT_H 1

View file

@ -17,7 +17,6 @@ You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */
#include "third_party/make/getopt.h"
/* clang-format off */
#ifdef HAVE_CONFIG_H
#include "third_party/make/config.h"

View file

@ -14,7 +14,6 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* clang-format off */
#include "third_party/make/config.h"
#include "third_party/make/getprogname.h"
#include "libc/intrin/safemacros.internal.h"

View file

@ -1,4 +1,3 @@
/* clang-format off */
/* Program name management.
Copyright (C) 2016-2020 Free Software Foundation, Inc.

View file

@ -1,4 +1,3 @@
/* clang-format off */
/* Convenience header for conditional use of GNU <libintl.h>.
Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2020 Free Software
Foundation, Inc.

View file

@ -1,4 +1,3 @@
/* clang-format off */
/* External interfaces usable by dynamic objects loaded into GNU Make.
--THIS API IS A "TECHNOLOGY PREVIEW" ONLY. IT IS NOT A STABLE INTERFACE--

View file

@ -1,4 +1,3 @@
/* clang-format off */
/* GNU Guile interface for GNU Make.
Copyright (C) 2011-2020 Free Software Foundation, Inc.
This file is part of GNU Make.

View file

@ -17,14 +17,13 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
#include "third_party/make/makeint.inc"
/**/
#include "libc/assert.h"
#include "libc/intrin/bits.h"
#include "libc/intrin/bsr.h"
#include "libc/intrin/likely.h"
#include "libc/log/check.h"
#include "libc/runtime/runtime.h"
#include "libc/x/x.h"
#include "libc/serialize.h"
#include "third_party/make/hash.h"
/* clang-format off */
#define CALLOC(t, n) ((t *) xcalloc (1, sizeof (t) * (n)))
#define MALLOC(t, n) ((t *) xmalloc (sizeof (t) * (n)))

View file

@ -1,4 +1,3 @@
/* clang-format off */
/* hash.h -- decls for hash table
Copyright (C) 1995, 1999, 2002, 2010 Free Software Foundation, Inc.
Written by Greg McGary <gkm@gnu.org> <greg@mcgary.org>

View file

@ -1,4 +1,3 @@
/* clang-format off */
/* Implicit rule searching for GNU Make.
Copyright (C) 1988-2020 Free Software Foundation, Inc.
This file is part of GNU Make.

View file

@ -1,4 +1,3 @@
/* clang-format off */
/* intprops.h -- properties of integer types
Copyright (C) 2001-2020 Free Software Foundation, Inc.

View file

@ -37,7 +37,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
#include "libc/fmt/conv.h"
#include "libc/fmt/itoa.h"
#include "libc/fmt/libgen.h"
#include "libc/intrin/bits.h"
#include "libc/intrin/promises.internal.h"
#include "libc/intrin/safemacros.internal.h"
#include "libc/log/backtrace.internal.h"
@ -65,8 +64,8 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
#include "third_party/make/dep.h"
#include "third_party/make/findprog.h"
#include "third_party/make/os.h"
#include "libc/serialize.h"
#include "third_party/make/variable.h"
// clang-format off
#define USE_POSIX_SPAWN (!IsLinux() && !IsOpenbsd())
#define HAVE_POSIX_SPAWNATTR_SETSIGMASK

View file

@ -1,4 +1,3 @@
/* clang-format off */
/* Definitions for managing subprocesses in GNU Make.
Copyright (C) 1992-2020 Free Software Foundation, Inc.
This file is part of GNU Make.

View file

@ -1,4 +1,3 @@
/* clang-format off */
/* Loading dynamic objects for GNU Make.
Copyright (C) 2012-2020 Free Software Foundation, Inc.
This file is part of GNU Make.

View file

@ -1,4 +1,3 @@
/* clang-format off */
/* API for GNU Make dynamic objects.
Copyright (C) 2013-2020 Free Software Foundation, Inc.
This file is part of GNU Make.

View file

@ -43,7 +43,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
#include "libc/sysv/consts/pr.h"
#include "libc/sysv/consts/sig.h"
#include "third_party/make/getopt.h"
// clang-format off
STATIC_STACK_SIZE(0x00800000); // 8mb stack

View file

@ -51,7 +51,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
#include "libc/time/time.h"
#include "third_party/gdtoa/gdtoa.h"
#include "third_party/musl/glob.h"
/* clang-format off */
/* We use <config.h> instead of "config.h" so that a compilation
using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h

View file

@ -1,4 +1,3 @@
/* clang-format off */
/* Miscellaneous generic support functions for GNU Make.
Copyright (C) 1988-2020 Free Software Foundation, Inc.
This file is part of GNU Make.

View file

@ -1,4 +1,3 @@
/* clang-format off */
/* Declarations for operating system interfaces for GNU Make.
Copyright (C) 2016-2020 Free Software Foundation, Inc.
This file is part of GNU Make.

View file

@ -14,7 +14,6 @@ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */
/* clang-format off */
#include "third_party/make/makeint.inc"
#include "third_party/make/os.h"
#include "third_party/make/output.h"

View file

@ -1,4 +1,3 @@
/* clang-format off */
/* Output to stdout / stderr for GNU make
Copyright (C) 2013-2020 Free Software Foundation, Inc.
This file is part of GNU Make.

View file

@ -25,7 +25,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
#include "third_party/make/debug.h"
#include "third_party/make/job.h"
#include "third_party/make/os.h"
/* clang-format off */
#ifdef MAKE_JOBSERVER

View file

@ -14,7 +14,6 @@ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */
/* clang-format off */
#include "third_party/make/makeint.inc"
#include "third_party/make/filedef.h"
#include "third_party/make/dep.h"

View file

@ -1,4 +1,3 @@
/* clang-format off */
/* Basic dependency engine for GNU Make.
Copyright (C) 1988-2020 Free Software Foundation, Inc.
This file is part of GNU Make.

View file

@ -1,4 +1,3 @@
/* clang-format off */
/* Template for the remote job exportation interface to GNU Make.
Copyright (C) 1988-2020 Free Software Foundation, Inc.
This file is part of GNU Make.

View file

@ -14,7 +14,6 @@ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */
/* clang-format off */
#include "third_party/make/makeint.inc"
#include "third_party/make/filedef.h"
#include "third_party/make/dep.h"

View file

@ -1,4 +1,3 @@
/* clang-format off */
/* Definitions for using pattern rules in GNU Make.
Copyright (C) 1988-2020 Free Software Foundation, Inc.
This file is part of GNU Make.

View file

@ -1,4 +1,3 @@
/* clang-format off */
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
/* A substitute for POSIX 2008 <stddef.h>, for platforms that have issues.

View file

@ -1,4 +1,3 @@
/* clang-format off */
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
/* Copyright (C) 2001-2002, 2004-2020 Free Software Foundation, Inc.
Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood.

View file

@ -1,4 +1,3 @@
/* clang-format off */
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
/* A GNU-like <stdio.h>.

View file

@ -1,4 +1,3 @@
/* clang-format off */
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
/* A GNU-like <stdlib.h>.

View file

@ -14,7 +14,6 @@ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */
/* clang-format off */
#include "third_party/make/makeint.inc"
#include "third_party/make/hash.h"

View file

@ -1,4 +1,3 @@
/* clang-format off */
/* stripslash.c -- remove redundant trailing slashes from a file name
Copyright (C) 1990, 2001, 2003-2006, 2009-2020 Free Software Foundation,

View file

@ -1,4 +1,3 @@
/* clang-format off */
#include "third_party/make/config.h"
#define _GL_UNISTD_INLINE _GL_EXTERN_INLINE
#include "third_party/make/unistd.h"

View file

@ -1,4 +1,3 @@
/* clang-format off */
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
/* Substitute for and wrapper around <unistd.h>.
Copyright (C) 2003-2020 Free Software Foundation, Inc.

View file

@ -1,4 +1,3 @@
/* clang-format off */
/* Internals of variables for GNU Make.
Copyright (C) 1988-2020 Free Software Foundation, Inc.
This file is part of GNU Make.

View file

@ -1,4 +1,3 @@
/* clang-format off */
/* Definitions for using variables in GNU Make.
Copyright (C) 1988-2020 Free Software Foundation, Inc.
This file is part of GNU Make.

View file

@ -1,4 +1,3 @@
/* clang-format off */
/* Record version and build host architecture for GNU make.
Copyright (C) 1988-2020 Free Software Foundation, Inc.
This file is part of GNU Make.

View file

@ -14,7 +14,6 @@ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */
/* clang-format off */
#include "third_party/make/makeint.inc"
#include "third_party/make/filedef.h"
#include "third_party/make/variable.h"

View file

@ -1,4 +1,3 @@
/* clang-format off */
/* Report a memory allocation failure and exit.
Copyright (C) 1997-2000, 2002-2004, 2006, 2009-2020 Free Software

View file

@ -1,4 +1,3 @@
/* clang-format off */
/* xalloc-oversized.h -- memory allocation size checking
Copyright (C) 1990-2000, 2003-2004, 2006-2020 Free Software Foundation, Inc.

View file

@ -1,4 +1,3 @@
/* clang-format off */
/* xalloc.h -- malloc with out-of-memory checking
Copyright (C) 1990-2000, 2003-2004, 2006-2020 Free Software Foundation, Inc.

View file

@ -1,4 +1,3 @@
/* clang-format off */
/* Construct a full filename from a directory and a relative filename.
Copyright (C) 2001-2004, 2006-2020 Free Software Foundation, Inc.

View file

@ -1,4 +1,3 @@
/* clang-format off */
/* xmalloc.c -- malloc with out of memory checking
Copyright (C) 1990-2000, 2002-2006, 2008-2020 Free Software Foundation, Inc.