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

@ -18,7 +18,6 @@
#include "libc/mem/mem.h"
#include "libc/stdio/stdio.h"
#include "libc/thread/thread.h"
// clang-format off
#ifndef NSYNC_ATM_LOG
#define NSYNC_ATM_LOG 0

View file

@ -16,7 +16,6 @@
limitations under the License.
*/
#include "third_party/nsync/testing/closure.h"
// clang-format off
void nsync_start_thread_ (void (*f) (void *), void *arg);

View file

@ -1,6 +1,5 @@
#ifndef NSYNC_TESTING_CLOSURE_H_
#define NSYNC_TESTING_CLOSURE_H_
/* clang-format off */
#include "libc/mem/mem.h"
/* A run-once, self-freeing closure. */

View file

@ -20,7 +20,6 @@
#include "third_party/nsync/testing/smprintf.h"
#include "third_party/nsync/testing/testing.h"
#include "third_party/nsync/testing/time_extra.h"
// clang-format off
/* Verify the properties of a zero counter. */
static void test_counter_zero (testing t) {

View file

@ -23,7 +23,6 @@
#include "third_party/nsync/testing/closure.h"
#include "third_party/nsync/testing/smprintf.h"
#include "third_party/nsync/testing/testing.h"
// clang-format off
/* A cv_stress_data represents the data used by the threads of the tests below. */
typedef struct cv_stress_data_s {

View file

@ -30,7 +30,6 @@
#include "third_party/nsync/testing/testing.h"
#include "third_party/nsync/testing/time_extra.h"
#include "third_party/nsync/time.h"
// clang-format off
/* --------------------------- */

View file

@ -25,7 +25,6 @@
#include "third_party/nsync/testing/smprintf.h"
#include "third_party/nsync/testing/testing.h"
#include "third_party/nsync/testing/time_extra.h"
// clang-format off
/* Example use of CV.wait(): A priority queue of strings whose
"remove_with_deadline" operation has a deadline. */

View file

@ -22,7 +22,6 @@
#include "third_party/nsync/array.internal.h"
#include "third_party/nsync/testing/smprintf.h"
#include "third_party/nsync/testing/testing.h"
// clang-format off
/* This tests internal abstractions. */

View file

@ -25,7 +25,6 @@
#include "third_party/nsync/testing/testing.h"
#include "third_party/nsync/testing/time_extra.h"
#include "third_party/nsync/time.h"
// clang-format off
/* Test the behaviour of mu in situations where starvation might be expected. */

View file

@ -25,7 +25,6 @@
#include "third_party/nsync/testing/smprintf.h"
#include "third_party/nsync/testing/testing.h"
#include "third_party/nsync/testing/time_extra.h"
// clang-format off
/* The state shared between the threads in each of the tests below. */
typedef struct test_data_s {

View file

@ -25,7 +25,6 @@
#include "third_party/nsync/testing/smprintf.h"
#include "third_party/nsync/testing/testing.h"
#include "third_party/nsync/testing/time_extra.h"
// clang-format off
/* Example use of nsync_mu_wait(): A priority queue of strings whose
"remove_with_deadline" operation has a deadline. */

View file

@ -25,7 +25,6 @@
#include "third_party/nsync/testing/testing.h"
#include "third_party/nsync/testing/time_extra.h"
#include "third_party/nsync/time.h"
// clang-format off
/* --------------------------- */

View file

@ -21,7 +21,6 @@
#include "third_party/nsync/testing/testing.h"
#include "third_party/nsync/testing/time_extra.h"
#include "third_party/nsync/time.h"
// clang-format off
/* Verify the properties of a prenotified note. */
static void test_note_prenotified (testing t) {

View file

@ -23,7 +23,6 @@
#include "third_party/nsync/testing/closure.h"
#include "third_party/nsync/testing/smprintf.h"
#include "third_party/nsync/testing/testing.h"
// clang-format off
/* This tests nsync_once */

View file

@ -27,7 +27,6 @@
#include "third_party/nsync/testing/smprintf.h"
#include "third_party/nsync/testing/testing.h"
#include "third_party/nsync/waiter.h"
// clang-format off
/* The benchmarks in this file use various mechanisms to
ping-pong back and forth between two threads as they count i from

View file

@ -19,7 +19,6 @@
#include "libc/mem/mem.h"
#include "libc/stdio/stdio.h"
#include "libc/str/str.h"
// clang-format off
char *smprintf (const char *fmt, ...) {
int m = strlen (fmt) * 2 + 1;

View file

@ -17,7 +17,6 @@
*/
#include "libc/mem/mem.h"
#include "libc/thread/thread.h"
// clang-format off
struct thd_args {
void (*f) (void *);

View file

@ -33,7 +33,6 @@
#include "third_party/nsync/testing/closure.h"
#include "third_party/nsync/testing/smprintf.h"
#include "third_party/nsync/testing/time_extra.h"
// clang-format off
struct testing_base_s {
int flags; /* flags from testing_new(); r/o after init */

View file

@ -1,6 +1,5 @@
#ifndef NSYNC_TESTING_TESTING_H_
#define NSYNC_TESTING_TESTING_H_
/* clang-format off */
typedef struct testing_base_s *testing_base;
typedef const struct testing_base_s *const_testing_base;

View file

@ -20,7 +20,6 @@
#include "third_party/nsync/testing/smprintf.h"
#include "third_party/nsync/testing/time_extra.h"
#include "third_party/nsync/time.h"
// clang-format off
char *nsync_time_str (nsync_time t, int decimals) {
static const struct {

View file

@ -25,7 +25,6 @@
#include "third_party/nsync/testing/time_extra.h"
#include "third_party/nsync/time.h"
#include "third_party/nsync/waiter.h"
// clang-format off
static void decrement_at (nsync_counter c, nsync_time abs_deadline, nsync_counter done) {
nsync_time_sleep_until (abs_deadline);