diff --git a/libc/calls/state.internal.h b/libc/calls/state.internal.h index 09743e4fa..4f9a4dc3b 100644 --- a/libc/calls/state.internal.h +++ b/libc/calls/state.internal.h @@ -1,6 +1,6 @@ #ifndef COSMOPOLITAN_LIBC_CALLS_STATE_INTERNAL_H_ #define COSMOPOLITAN_LIBC_CALLS_STATE_INTERNAL_H_ -#include "libc/intrin/nopl.h" +#include "libc/intrin/nopl.internal.h" #include "libc/thread/thread.h" #include "libc/thread/tls.h" #if !(__ASSEMBLER__ + __LINKER__ + 0) diff --git a/libc/intrin/bigword.internal.h b/libc/intrin/bigword.internal.h deleted file mode 100644 index 4bf33dced..000000000 --- a/libc/intrin/bigword.internal.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef COSMOPOLITAN_LIBC_BITS_BIGWORD_H_ -#define COSMOPOLITAN_LIBC_BITS_BIGWORD_H_ - -#ifndef BIGWORD -#if __AVX512F__ + 0 -#define BIGWORD 64 -#elif __AVX2__ + 0 -#define BIGWORD 32 -#elif __SSE2__ + 0 -#define BIGWORD 16 -#else -#define BIGWORD __BIGGEST_ALIGNMENT__ -#endif -#endif /*BIGWORD*/ - -#endif /* COSMOPOLITAN_LIBC_BITS_BIGWORD_H_ */ diff --git a/libc/intrin/cmpxchg.c b/libc/intrin/cmpxchg.c deleted file mode 100644 index f8e363138..000000000 --- a/libc/intrin/cmpxchg.c +++ /dev/null @@ -1,47 +0,0 @@ -/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│ -│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│ -╞══════════════════════════════════════════════════════════════════════════════╡ -│ Copyright 2021 Justine Alexandra Roberts Tunney │ -│ │ -│ Permission to use, copy, modify, and/or distribute this software for │ -│ any purpose with or without fee is hereby granted, provided that the │ -│ above copyright notice and this permission notice appear in all copies. │ -│ │ -│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │ -│ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │ -│ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │ -│ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │ -│ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │ -│ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │ -│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ -│ PERFORMANCE OF THIS SOFTWARE. │ -╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/intrin/cmpxchg.h" - -/** - * Compares and exchanges. - * - * @param ifthing is uint𝑘_t[hasatleast 1] where 𝑘 ∈ {8,16,32,64} - * @param size is automatically supplied by macro wrapper - * @return true if value was exchanged, otherwise false - * @see _lockcmpxchg() - */ -bool(_cmpxchg)(void *ifthing, intptr_t isequaltome, intptr_t replaceitwithme, - size_t size) { - switch (size) { - case 1: - return _cmpxchg((int8_t *)ifthing, (int8_t)isequaltome, - (int8_t)replaceitwithme); - case 2: - return _cmpxchg((int16_t *)ifthing, (int16_t)isequaltome, - (int16_t)replaceitwithme); - case 4: - return _cmpxchg((int32_t *)ifthing, (int32_t)isequaltome, - (int32_t)replaceitwithme); - case 8: - return _cmpxchg((int64_t *)ifthing, (int64_t)isequaltome, - (int64_t)replaceitwithme); - default: - return false; - } -} diff --git a/libc/intrin/cmpxchg.h b/libc/intrin/cmpxchg.h index 3ba5a734a..54e45d5dc 100644 --- a/libc/intrin/cmpxchg.h +++ b/libc/intrin/cmpxchg.h @@ -4,8 +4,6 @@ #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ -bool _cmpxchg(void *, intptr_t, intptr_t, size_t); - #if defined(__GNUC__) && !defined(__STRICT_ANSI__) && defined(__x86__) #define _cmpxchg(IFTHING, ISEQUALTOME, REPLACEITWITHME) \ ({ \ @@ -19,9 +17,6 @@ bool _cmpxchg(void *, intptr_t, intptr_t, size_t); : "cc"); \ DidIt; \ }) -#else -#define _cmpxchg(MEM, CMP, VAL) \ - _cmpxchg(MEM, (intptr_t)(CMP), (intptr_t)(VAL), sizeof(*(MEM))) #endif /* GNUC && !ANSI && x86 */ COSMOPOLITAN_C_END_ diff --git a/libc/intrin/cxaatexit.internal.h b/libc/intrin/cxaatexit.internal.h index 46c3aacaf..bf96a4e47 100644 --- a/libc/intrin/cxaatexit.internal.h +++ b/libc/intrin/cxaatexit.internal.h @@ -1,6 +1,6 @@ #ifndef COSMOPOLITAN_LIBC_RUNTIME_CXAATEXIT_H_ #define COSMOPOLITAN_LIBC_RUNTIME_CXAATEXIT_H_ -#include "libc/intrin/nopl.h" +#include "libc/intrin/nopl.internal.h" #include "libc/thread/tls.h" #include "libc/stdio/stdio.h" #if !(__ASSEMBLER__ + __LINKER__ + 0) diff --git a/libc/intrin/lockcmpxchg.c b/libc/intrin/lockcmpxchg.c deleted file mode 100644 index 126659419..000000000 --- a/libc/intrin/lockcmpxchg.c +++ /dev/null @@ -1,47 +0,0 @@ -/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│ -│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│ -╞══════════════════════════════════════════════════════════════════════════════╡ -│ Copyright 2021 Justine Alexandra Roberts Tunney │ -│ │ -│ Permission to use, copy, modify, and/or distribute this software for │ -│ any purpose with or without fee is hereby granted, provided that the │ -│ above copyright notice and this permission notice appear in all copies. │ -│ │ -│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │ -│ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │ -│ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │ -│ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │ -│ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │ -│ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │ -│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ -│ PERFORMANCE OF THIS SOFTWARE. │ -╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/intrin/lockcmpxchg.h" - -/** - * Compares and exchanges w/ lock prefix. - * - * @param ifthing is uint𝑘_t[hasatleast 1] where 𝑘 ∈ {8,16,32,64} - * @param size is automatically supplied by macro wrapper - * @return true if value was exchanged, otherwise false - * @see cmpxchg() if only written by one thread - */ -bool(_lockcmpxchg)(void *ifthing, intptr_t isequaltome, - intptr_t replaceitwithme, size_t size) { - switch (size) { - case 1: - return _lockcmpxchg((int8_t *)ifthing, (int8_t)isequaltome, - (int8_t)replaceitwithme); - case 2: - return _lockcmpxchg((int16_t *)ifthing, (int16_t)isequaltome, - (int16_t)replaceitwithme); - case 4: - return _lockcmpxchg((int32_t *)ifthing, (int32_t)isequaltome, - (int32_t)replaceitwithme); - case 8: - return _lockcmpxchg((int64_t *)ifthing, (int64_t)isequaltome, - (int64_t)replaceitwithme); - default: - return false; - } -} diff --git a/libc/intrin/lockcmpxchg.h b/libc/intrin/lockcmpxchg.h index 6f8b687ed..d025e8d58 100644 --- a/libc/intrin/lockcmpxchg.h +++ b/libc/intrin/lockcmpxchg.h @@ -4,8 +4,6 @@ #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ -bool _lockcmpxchg(void *, intptr_t, intptr_t, size_t); - #if defined(__GNUC__) && !defined(__STRICT_ANSI__) && defined(__x86__) #define _lockcmpxchg(IFTHING, ISEQUALTOME, REPLACEITWITHME) \ ({ \ @@ -19,9 +17,6 @@ bool _lockcmpxchg(void *, intptr_t, intptr_t, size_t); : "cc"); \ DidIt; \ }) -#else -#define _lockcmpxchg(MEM, CMP, VAL) \ - _lockcmpxchg(MEM, (intptr_t)(CMP), (intptr_t)(VAL), sizeof(*(MEM))) #endif /* GNUC && !ANSI && x86 */ COSMOPOLITAN_C_END_ diff --git a/libc/intrin/nopl.h b/libc/intrin/nopl.internal.h similarity index 100% rename from libc/intrin/nopl.h rename to libc/intrin/nopl.internal.h diff --git a/libc/isystem/stdio.h b/libc/isystem/stdio.h index 9e5d61618..cff507487 100644 --- a/libc/isystem/stdio.h +++ b/libc/isystem/stdio.h @@ -2,7 +2,7 @@ #define LIBC_ISYSTEM_STDIO_H_ #include "libc/calls/calls.h" #include "libc/fmt/fmt.h" -#include "libc/stdio/lock.h" +#include "libc/stdio/lock.internal.h" #include "libc/stdio/stdio.h" #include "libc/stdio/temp.h" #endif diff --git a/libc/log/vflogf.c b/libc/log/vflogf.c index c8941e48b..627889fa4 100644 --- a/libc/log/vflogf.c +++ b/libc/log/vflogf.c @@ -32,7 +32,7 @@ #include "libc/math.h" #include "libc/nexgen32e/nexgen32e.h" #include "libc/runtime/runtime.h" -#include "libc/stdio/lock.h" +#include "libc/stdio/lock.internal.h" #include "libc/stdio/stdio.h" #include "libc/str/str.h" #include "libc/sysv/consts/fileno.h" diff --git a/libc/runtime/ftracer.c b/libc/runtime/ftracer.c index 4bdbd82fd..9e3ae1d7d 100644 --- a/libc/runtime/ftracer.c +++ b/libc/runtime/ftracer.c @@ -21,7 +21,7 @@ #include "libc/fmt/itoa.h" #include "libc/intrin/cmpxchg.h" #include "libc/intrin/kprintf.h" -#include "libc/intrin/nopl.h" +#include "libc/intrin/nopl.internal.h" #include "libc/macros.internal.h" #include "libc/nexgen32e/stackframe.h" #include "libc/runtime/internal.h" diff --git a/libc/runtime/memtrack.internal.h b/libc/runtime/memtrack.internal.h index 0e1c10af5..ff2488f0a 100644 --- a/libc/runtime/memtrack.internal.h +++ b/libc/runtime/memtrack.internal.h @@ -3,7 +3,7 @@ #include "libc/assert.h" #include "libc/intrin/midpoint.h" #include "libc/dce.h" -#include "libc/intrin/nopl.h" +#include "libc/intrin/nopl.internal.h" #include "libc/macros.internal.h" #include "libc/thread/tls.h" #include "libc/nt/version.h" diff --git a/libc/stdio/clearerr.c b/libc/stdio/clearerr.c index 723847951..1ff0ae2b6 100644 --- a/libc/stdio/clearerr.c +++ b/libc/stdio/clearerr.c @@ -16,7 +16,7 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/stdio/lock.h" +#include "libc/stdio/lock.internal.h" #include "libc/stdio/stdio.h" /** diff --git a/libc/stdio/dirstream.c b/libc/stdio/dirstream.c index 60531888e..e382cd254 100644 --- a/libc/stdio/dirstream.c +++ b/libc/stdio/dirstream.c @@ -25,7 +25,7 @@ #include "libc/calls/syscall_support-nt.internal.h" #include "libc/errno.h" #include "libc/intrin/asan.internal.h" -#include "libc/intrin/nopl.h" +#include "libc/intrin/nopl.internal.h" #include "libc/thread/thread.h" #include "libc/intrin/weaken.h" #include "libc/mem/mem.h" diff --git a/libc/stdio/feof.c b/libc/stdio/feof.c index e115f9715..ac225d98a 100644 --- a/libc/stdio/feof.c +++ b/libc/stdio/feof.c @@ -16,7 +16,7 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/stdio/lock.h" +#include "libc/stdio/lock.internal.h" #include "libc/stdio/stdio.h" /** diff --git a/libc/stdio/ferror.c b/libc/stdio/ferror.c index 22b46d0c0..7b8905d0f 100644 --- a/libc/stdio/ferror.c +++ b/libc/stdio/ferror.c @@ -16,7 +16,7 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/stdio/lock.h" +#include "libc/stdio/lock.internal.h" #include "libc/stdio/stdio.h" /** diff --git a/libc/stdio/fflush.c b/libc/stdio/fflush.c index 8f454dde7..90da7fa6b 100644 --- a/libc/stdio/fflush.c +++ b/libc/stdio/fflush.c @@ -16,7 +16,7 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/stdio/lock.h" +#include "libc/stdio/lock.internal.h" #include "libc/stdio/stdio.h" /** diff --git a/libc/stdio/fflush.internal.h b/libc/stdio/fflush.internal.h index 6eb92461e..cc3343d3a 100644 --- a/libc/stdio/fflush.internal.h +++ b/libc/stdio/fflush.internal.h @@ -1,6 +1,6 @@ #ifndef COSMOPOLITAN_LIBC_STDIO_FFLUSH_H_ #define COSMOPOLITAN_LIBC_STDIO_FFLUSH_H_ -#include "libc/intrin/nopl.h" +#include "libc/intrin/nopl.internal.h" #include "libc/thread/thread.h" #include "libc/stdio/stdio.h" #if !(__ASSEMBLER__ + __LINKER__ + 0) diff --git a/libc/stdio/fgetc.c b/libc/stdio/fgetc.c index b04afd66c..8dda15ace 100644 --- a/libc/stdio/fgetc.c +++ b/libc/stdio/fgetc.c @@ -16,7 +16,7 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/stdio/lock.h" +#include "libc/stdio/lock.internal.h" #include "libc/stdio/stdio.h" /** diff --git a/libc/stdio/fgetln.c b/libc/stdio/fgetln.c index a131e9dfc..04f8edfca 100644 --- a/libc/stdio/fgetln.c +++ b/libc/stdio/fgetln.c @@ -16,7 +16,7 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/stdio/lock.h" +#include "libc/stdio/lock.internal.h" #include "libc/stdio/stdio.h" /** diff --git a/libc/stdio/fgets.c b/libc/stdio/fgets.c index 2807ef537..121260ee9 100644 --- a/libc/stdio/fgets.c +++ b/libc/stdio/fgets.c @@ -16,7 +16,7 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/stdio/lock.h" +#include "libc/stdio/lock.internal.h" #include "libc/stdio/stdio.h" /** diff --git a/libc/stdio/fgetwc.c b/libc/stdio/fgetwc.c index d7e1e41f8..aecf07615 100644 --- a/libc/stdio/fgetwc.c +++ b/libc/stdio/fgetwc.c @@ -16,7 +16,7 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/stdio/lock.h" +#include "libc/stdio/lock.internal.h" #include "libc/stdio/stdio.h" /** diff --git a/libc/stdio/fgetws.c b/libc/stdio/fgetws.c index 3c96e30d9..f116a51f5 100644 --- a/libc/stdio/fgetws.c +++ b/libc/stdio/fgetws.c @@ -16,7 +16,7 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/stdio/lock.h" +#include "libc/stdio/lock.internal.h" #include "libc/stdio/stdio.h" /** diff --git a/libc/stdio/fileno.c b/libc/stdio/fileno.c index e739d1cb5..696e7f7a2 100644 --- a/libc/stdio/fileno.c +++ b/libc/stdio/fileno.c @@ -16,7 +16,7 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/stdio/lock.h" +#include "libc/stdio/lock.internal.h" #include "libc/stdio/stdio.h" #include "libc/sysv/errfuns.h" diff --git a/libc/stdio/flockfile.c b/libc/stdio/flockfile.c index e1a3872ca..36ae8a3e5 100644 --- a/libc/stdio/flockfile.c +++ b/libc/stdio/flockfile.c @@ -16,7 +16,7 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/stdio/lock.h" +#include "libc/stdio/lock.internal.h" #include "libc/stdio/stdio.h" /** diff --git a/libc/stdio/flushlbf.c b/libc/stdio/flushlbf.c index ff4abcb5d..a254e3c3c 100644 --- a/libc/stdio/flushlbf.c +++ b/libc/stdio/flushlbf.c @@ -19,7 +19,7 @@ #include "libc/calls/calls.h" #include "libc/thread/thread.h" #include "libc/stdio/fflush.internal.h" -#include "libc/stdio/lock.h" +#include "libc/stdio/lock.internal.h" #include "libc/stdio/stdio.h" #include "libc/stdio/stdio_ext.h" diff --git a/libc/stdio/fprintf.c b/libc/stdio/fprintf.c index 796394dc7..fd512ca11 100644 --- a/libc/stdio/fprintf.c +++ b/libc/stdio/fprintf.c @@ -16,7 +16,7 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/stdio/lock.h" +#include "libc/stdio/lock.internal.h" #include "libc/stdio/stdio.h" /** diff --git a/libc/stdio/fputc.c b/libc/stdio/fputc.c index faf8af218..28b8a3b72 100644 --- a/libc/stdio/fputc.c +++ b/libc/stdio/fputc.c @@ -16,7 +16,7 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/stdio/lock.h" +#include "libc/stdio/lock.internal.h" #include "libc/stdio/stdio.h" /** diff --git a/libc/stdio/fputs.c b/libc/stdio/fputs.c index 85bf483e6..f7adc65d9 100644 --- a/libc/stdio/fputs.c +++ b/libc/stdio/fputs.c @@ -16,7 +16,7 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/stdio/lock.h" +#include "libc/stdio/lock.internal.h" #include "libc/stdio/stdio.h" /** diff --git a/libc/stdio/fputwc.c b/libc/stdio/fputwc.c index 44afd3e04..6356c1aed 100644 --- a/libc/stdio/fputwc.c +++ b/libc/stdio/fputwc.c @@ -16,7 +16,7 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/stdio/lock.h" +#include "libc/stdio/lock.internal.h" #include "libc/stdio/stdio.h" /** diff --git a/libc/stdio/fputws.c b/libc/stdio/fputws.c index e93151095..c828e0878 100644 --- a/libc/stdio/fputws.c +++ b/libc/stdio/fputws.c @@ -16,7 +16,7 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/stdio/lock.h" +#include "libc/stdio/lock.internal.h" #include "libc/stdio/stdio.h" /** diff --git a/libc/stdio/fread.c b/libc/stdio/fread.c index f926a9517..f5f96007a 100644 --- a/libc/stdio/fread.c +++ b/libc/stdio/fread.c @@ -16,7 +16,7 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/stdio/lock.h" +#include "libc/stdio/lock.internal.h" #include "libc/stdio/stdio.h" /** diff --git a/libc/stdio/freopen.c b/libc/stdio/freopen.c index 8799d6775..bcebc8fd7 100644 --- a/libc/stdio/freopen.c +++ b/libc/stdio/freopen.c @@ -17,7 +17,7 @@ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/calls.h" -#include "libc/stdio/lock.h" +#include "libc/stdio/lock.internal.h" #include "libc/stdio/stdio.h" #include "libc/sysv/consts/f.h" #include "libc/sysv/consts/fd.h" diff --git a/libc/stdio/fseeko.c b/libc/stdio/fseeko.c index b29b98c30..d0d8d265f 100644 --- a/libc/stdio/fseeko.c +++ b/libc/stdio/fseeko.c @@ -16,7 +16,7 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/stdio/lock.h" +#include "libc/stdio/lock.internal.h" #include "libc/stdio/stdio.h" /** diff --git a/libc/stdio/ftello.c b/libc/stdio/ftello.c index 7ce952ca2..0f12ba119 100644 --- a/libc/stdio/ftello.c +++ b/libc/stdio/ftello.c @@ -20,7 +20,7 @@ #include "libc/errno.h" #include "libc/runtime/runtime.h" #include "libc/stdio/internal.h" -#include "libc/stdio/lock.h" +#include "libc/stdio/lock.internal.h" #include "libc/stdio/stdio.h" #include "libc/sysv/consts/o.h" diff --git a/libc/stdio/fwrite.c b/libc/stdio/fwrite.c index 4522b636b..915b0a21c 100644 --- a/libc/stdio/fwrite.c +++ b/libc/stdio/fwrite.c @@ -16,7 +16,7 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/stdio/lock.h" +#include "libc/stdio/lock.internal.h" #include "libc/stdio/stdio.h" /** diff --git a/libc/stdio/getdelim.c b/libc/stdio/getdelim.c index 055c22ead..040cfc968 100644 --- a/libc/stdio/getdelim.c +++ b/libc/stdio/getdelim.c @@ -16,7 +16,7 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/stdio/lock.h" +#include "libc/stdio/lock.internal.h" #include "libc/stdio/stdio.h" /** diff --git a/libc/stdio/lock.h b/libc/stdio/lock.internal.h similarity index 81% rename from libc/stdio/lock.h rename to libc/stdio/lock.internal.h index 8b33439b6..99775cb82 100644 --- a/libc/stdio/lock.h +++ b/libc/stdio/lock.internal.h @@ -1,15 +1,11 @@ #ifndef COSMOPOLITAN_LIBC_STDIO_LOCK_H_ #define COSMOPOLITAN_LIBC_STDIO_LOCK_H_ -#include "libc/intrin/nopl.h" -#include "libc/thread/tls.h" +#include "libc/intrin/nopl.internal.h" #include "libc/stdio/stdio.h" +#include "libc/thread/tls.h" #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ -void flockfile(FILE *) paramsnonnull(); -void funlockfile(FILE *) paramsnonnull(); -int ftrylockfile(FILE *) paramsnonnull(); - #ifdef _NOPL1 #define flockfile(f) _NOPL1("__threadcalls", flockfile, f) #define funlockfile(f) _NOPL1("__threadcalls", funlockfile, f) diff --git a/libc/stdio/puts.c b/libc/stdio/puts.c index aafa06732..cae291488 100644 --- a/libc/stdio/puts.c +++ b/libc/stdio/puts.c @@ -16,7 +16,7 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/stdio/lock.h" +#include "libc/stdio/lock.internal.h" #include "libc/stdio/stdio.h" #include "libc/str/str.h" diff --git a/libc/stdio/rewind.c b/libc/stdio/rewind.c index d97050f43..6ad7a680d 100644 --- a/libc/stdio/rewind.c +++ b/libc/stdio/rewind.c @@ -17,7 +17,7 @@ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/calls.h" -#include "libc/stdio/lock.h" +#include "libc/stdio/lock.internal.h" #include "libc/stdio/stdio.h" /** diff --git a/libc/stdio/setvbuf.c b/libc/stdio/setvbuf.c index 1c2aa00eb..ac58cf08e 100644 --- a/libc/stdio/setvbuf.c +++ b/libc/stdio/setvbuf.c @@ -17,7 +17,7 @@ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/runtime/runtime.h" -#include "libc/stdio/lock.h" +#include "libc/stdio/lock.internal.h" #include "libc/stdio/stdio.h" #include "libc/sysv/errfuns.h" diff --git a/libc/stdio/stdio.h b/libc/stdio/stdio.h index c7c03d81c..401e344e2 100644 --- a/libc/stdio/stdio.h +++ b/libc/stdio/stdio.h @@ -50,6 +50,9 @@ int fileno(FILE *) paramsnonnull() nosideeffect; int fputc(int, FILE *) paramsnonnull(); int fputs(const char *, FILE *) paramsnonnull(); int fputws(const wchar_t *, FILE *) paramsnonnull(); +void flockfile(FILE *) paramsnonnull(); +void funlockfile(FILE *) paramsnonnull(); +int ftrylockfile(FILE *) paramsnonnull(); char *fgets(char *, int, FILE *) paramsnonnull(); wchar_t *fgetws(wchar_t *, int, FILE *) paramsnonnull(); wint_t putwc(wchar_t, FILE *) paramsnonnull(); diff --git a/libc/stdio/ungetc.c b/libc/stdio/ungetc.c index df066d05e..7c1bb6535 100644 --- a/libc/stdio/ungetc.c +++ b/libc/stdio/ungetc.c @@ -16,7 +16,7 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/stdio/lock.h" +#include "libc/stdio/lock.internal.h" #include "libc/stdio/stdio.h" /** diff --git a/libc/stdio/ungetwc.c b/libc/stdio/ungetwc.c index f0c482c9c..8fb59f6ea 100644 --- a/libc/stdio/ungetwc.c +++ b/libc/stdio/ungetwc.c @@ -16,7 +16,7 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/stdio/lock.h" +#include "libc/stdio/lock.internal.h" #include "libc/stdio/stdio.h" /** diff --git a/libc/stdio/vfprintf.c b/libc/stdio/vfprintf.c index c44db47ea..6978a0a26 100644 --- a/libc/stdio/vfprintf.c +++ b/libc/stdio/vfprintf.c @@ -16,7 +16,7 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/stdio/lock.h" +#include "libc/stdio/lock.internal.h" #include "libc/stdio/stdio.h" /** diff --git a/libc/time/localtime.c b/libc/time/localtime.c index 1b0458a32..f52e4f2f1 100644 --- a/libc/time/localtime.c +++ b/libc/time/localtime.c @@ -4,7 +4,7 @@ #define LOCALTIME_IMPLEMENTATION #include "libc/calls/calls.h" #include "libc/intrin/bits.h" -#include "libc/intrin/nopl.h" +#include "libc/intrin/nopl.internal.h" #include "libc/thread/thread.h" #include "libc/mem/mem.h" #include "libc/thread/tls.h" diff --git a/libc/zipos/zipos.internal.h b/libc/zipos/zipos.internal.h index 25ab4545d..764916634 100644 --- a/libc/zipos/zipos.internal.h +++ b/libc/zipos/zipos.internal.h @@ -1,6 +1,6 @@ #ifndef COSMOPOLITAN_LIBC_ZIPOS_ZIPOS_H_ #define COSMOPOLITAN_LIBC_ZIPOS_ZIPOS_H_ -#include "libc/intrin/nopl.h" +#include "libc/intrin/nopl.internal.h" #include "libc/thread/tls.h" #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ diff --git a/test/libc/calls/pledge_test.c b/test/libc/calls/pledge_test.c index 56389f7f8..988f8ec8e 100644 --- a/test/libc/calls/pledge_test.c +++ b/test/libc/calls/pledge_test.c @@ -36,7 +36,7 @@ #include "libc/runtime/runtime.h" #include "libc/sock/sock.h" #include "libc/sock/struct/sockaddr.h" -#include "libc/stdio/lock.h" +#include "libc/stdio/lock.internal.h" #include "libc/stdio/stdio.h" #include "libc/sysv/consts/af.h" #include "libc/sysv/consts/at.h" diff --git a/test/libc/stdio/fputc_test.c b/test/libc/stdio/fputc_test.c index 8b02a0de3..e11599b06 100644 --- a/test/libc/stdio/fputc_test.c +++ b/test/libc/stdio/fputc_test.c @@ -18,7 +18,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/calls.h" #include "libc/runtime/internal.h" -#include "libc/stdio/lock.h" +#include "libc/stdio/lock.internal.h" #include "libc/stdio/stdio.h" #include "libc/str/str.h" #include "libc/testlib/ezbench.h" diff --git a/third_party/awk/awkgram.tab.c b/third_party/awk/awkgram.tab.c index 96b3555eb..1acd78ab9 100644 --- a/third_party/awk/awkgram.tab.c +++ b/third_party/awk/awkgram.tab.c @@ -21,7 +21,7 @@ #line 26 "awkgram.y" #include "libc/calls/calls.h" #include "libc/fmt/fmt.h" -#include "libc/stdio/lock.h" +#include "libc/stdio/lock.internal.h" #include "libc/stdio/stdio.h" #include "libc/stdio/temp.h" #include "libc/mem/alg.h" diff --git a/third_party/awk/awkgram.y b/third_party/awk/awkgram.y index 04104b35d..7c449cabe 100644 --- a/third_party/awk/awkgram.y +++ b/third_party/awk/awkgram.y @@ -25,7 +25,7 @@ THIS SOFTWARE. %{ #include "libc/calls/calls.h" #include "libc/fmt/fmt.h" -#include "libc/stdio/lock.h" +#include "libc/stdio/lock.internal.h" #include "libc/stdio/stdio.h" #include "libc/stdio/temp.h" #include "libc/mem/alg.h" diff --git a/third_party/awk/lex.c b/third_party/awk/lex.c index 92616986e..4bfa01d83 100644 --- a/third_party/awk/lex.c +++ b/third_party/awk/lex.c @@ -31,7 +31,7 @@ #include "libc/mem/alg.h" #include "libc/mem/mem.h" #include "libc/runtime/runtime.h" -#include "libc/stdio/lock.h" +#include "libc/stdio/lock.internal.h" #include "libc/stdio/rand.h" #include "libc/stdio/stdio.h" #include "libc/stdio/temp.h" diff --git a/third_party/awk/lib.c b/third_party/awk/lib.c index 08cfef0de..287619ec8 100644 --- a/third_party/awk/lib.c +++ b/third_party/awk/lib.c @@ -36,7 +36,7 @@ #include "libc/mem/mem.h" #include "libc/nexgen32e/ffs.h" #include "libc/runtime/runtime.h" -#include "libc/stdio/lock.h" +#include "libc/stdio/lock.internal.h" #include "libc/stdio/rand.h" #include "libc/stdio/stdio.h" #include "libc/stdio/temp.h" diff --git a/third_party/gdtoa/lock.h b/third_party/gdtoa/lock.h index 06191e67d..107bc3358 100644 --- a/third_party/gdtoa/lock.h +++ b/third_party/gdtoa/lock.h @@ -1,6 +1,6 @@ #ifndef COSMOPOLITAN_THIRD_PARTY_GDTOA_LOCK_H_ #define COSMOPOLITAN_THIRD_PARTY_GDTOA_LOCK_H_ -#include "libc/intrin/nopl.h" +#include "libc/intrin/nopl.internal.h" #include "libc/thread/tls.h" #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ diff --git a/third_party/lua/liolib.c b/third_party/lua/liolib.c index 89d6fa9ea..6eced3349 100644 --- a/third_party/lua/liolib.c +++ b/third_party/lua/liolib.c @@ -30,7 +30,7 @@ #include "libc/calls/calls.h" #include "libc/calls/weirdtypes.h" #include "libc/errno.h" -#include "libc/stdio/lock.h" +#include "libc/stdio/lock.internal.h" #include "libc/stdio/stdio.h" #include "libc/stdio/temp.h" #include "libc/str/str.h" diff --git a/third_party/lua/lrepl.h b/third_party/lua/lrepl.h index f61240bcc..199f696a2 100644 --- a/third_party/lua/lrepl.h +++ b/third_party/lua/lrepl.h @@ -1,6 +1,6 @@ #ifndef COSMOPOLITAN_THIRD_PARTY_LUA_LREPL_H_ #define COSMOPOLITAN_THIRD_PARTY_LUA_LREPL_H_ -#include "libc/intrin/nopl.h" +#include "libc/intrin/nopl.internal.h" #include "third_party/linenoise/linenoise.h" #include "third_party/lua/lauxlib.h" #if !(__ASSEMBLER__ + __LINKER__ + 0) diff --git a/third_party/python/Objects/fileobject.c b/third_party/python/Objects/fileobject.c index 5f3186f27..4f591d0f9 100644 --- a/third_party/python/Objects/fileobject.c +++ b/third_party/python/Objects/fileobject.c @@ -7,7 +7,7 @@ #define PY_SSIZE_T_CLEAN #include "libc/calls/calls.h" #include "libc/errno.h" -#include "libc/stdio/lock.h" +#include "libc/stdio/lock.internal.h" #include "third_party/python/Include/abstract.h" #include "third_party/python/Include/boolobject.h" #include "third_party/python/Include/bytesobject.h" diff --git a/third_party/sed/compile.c b/third_party/sed/compile.c index aaa7a950a..fe9fa8f11 100644 --- a/third_party/sed/compile.c +++ b/third_party/sed/compile.c @@ -63,7 +63,7 @@ #include "third_party/regex/regex.h" #include "libc/calls/calls.h" #include "libc/fmt/fmt.h" -#include "libc/stdio/lock.h" +#include "libc/stdio/lock.internal.h" #include "libc/stdio/stdio.h" #include "libc/stdio/temp.h" #include "libc/mem/alg.h" diff --git a/third_party/sed/main.c b/third_party/sed/main.c index cf0b97318..e525ebb5f 100644 --- a/third_party/sed/main.c +++ b/third_party/sed/main.c @@ -91,7 +91,7 @@ #define _WITH_GETLINE #include "libc/calls/calls.h" #include "libc/fmt/fmt.h" -#include "libc/stdio/lock.h" +#include "libc/stdio/lock.internal.h" #include "libc/stdio/stdio.h" #include "libc/stdio/temp.h" #include "libc/mem/alg.h" diff --git a/third_party/sed/misc.c b/third_party/sed/misc.c index 1548bfdc9..52b676c2a 100644 --- a/third_party/sed/misc.c +++ b/third_party/sed/misc.c @@ -48,7 +48,7 @@ #include "third_party/regex/regex.h" #include "libc/calls/calls.h" #include "libc/fmt/fmt.h" -#include "libc/stdio/lock.h" +#include "libc/stdio/lock.internal.h" #include "libc/stdio/stdio.h" #include "libc/stdio/temp.h" #include "libc/mem/alg.h" diff --git a/third_party/sed/process.c b/third_party/sed/process.c index e5199a72c..7b1d3d750 100644 --- a/third_party/sed/process.c +++ b/third_party/sed/process.c @@ -74,7 +74,7 @@ #include "third_party/regex/regex.h" #include "libc/calls/calls.h" #include "libc/fmt/fmt.h" -#include "libc/stdio/lock.h" +#include "libc/stdio/lock.internal.h" #include "libc/stdio/stdio.h" #include "libc/stdio/temp.h" #include "libc/mem/alg.h" diff --git a/third_party/zip/zipfile.c b/third_party/zip/zipfile.c index 9a85e5b1d..47c0b4231 100644 --- a/third_party/zip/zipfile.c +++ b/third_party/zip/zipfile.c @@ -17,7 +17,7 @@ #include "third_party/zip/zip.h" #include "third_party/zip/revision.h" #ifdef UNICODE_SUPPORT -#include "libc/stdio/lock.h" +#include "libc/stdio/lock.internal.h" #include "third_party/zip/crc32.h" #endif