Clean up some code

- Use good ELF technique in cosmo_dlopen()
- Make strerror() conform more to other libc impls
- Introduce __clear_cache() and use it in cosmo_dlopen()
- Remove libc/fmt/fmt.h header (trying to kill off LIBC_FMT)
This commit is contained in:
Justine Tunney 2023-11-16 16:34:53 -08:00
parent 7010a8081e
commit 68c7c9c1e0
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
244 changed files with 378 additions and 588 deletions

View file

@ -2921,7 +2921,7 @@ Invalid file name:
>>> print(normalize(err)) # doctest: +ELLIPSIS
Traceback (most recent call last):
...
FileNotFoundError: [Errno 2] ENOENT...
FileNotFoundError: [Errno 2] No such file or directory...
Invalid doctest option:

View file

@ -6,7 +6,6 @@
*/
#include "libc/assert.h"
#include "libc/calls/weirdtypes.h"
#include "libc/fmt/fmt.h"
#include "libc/math.h"
#include "libc/time/struct/tm.h"
#include "third_party/python/Include/abstract.h"

View file

@ -27,7 +27,6 @@
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "libc/fmt/fmt.h"
#include "third_party/python/Include/abstract.h"
#include "third_party/python/Include/boolobject.h"
#include "third_party/python/Include/complexobject.h"

View file

@ -28,7 +28,6 @@
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "libc/errno.h"
#include "libc/fmt/fmt.h"
#include "libc/str/locale.h"
#include "libc/str/unicode.h"
#include "third_party/python/Modules/_decimal/libmpdec/bits.h"

View file

@ -9,7 +9,6 @@
#include "libc/calls/calls.h"
#include "libc/calls/weirdtypes.h"
#include "libc/errno.h"
#include "libc/fmt/fmt.h"
#include "libc/limits.h"
#include "libc/math.h"
#include "libc/mem/mem.h"

View file

@ -5,7 +5,6 @@
https://docs.python.org/3/license.html │
*/
#include "third_party/python/Include/pyexpat.h"
#include "libc/fmt/fmt.h"
#include "third_party/python/Include/abstract.h"
#include "third_party/python/Include/boolobject.h"
#include "third_party/python/Include/bytearrayobject.h"

View file

@ -6,7 +6,6 @@
*/
#define PY_SSIZE_T_CLEAN
#include "third_party/python/Modules/unicodedata.h"
#include "libc/fmt/fmt.h"
#include "libc/nexgen32e/kompressor.h"
#include "third_party/python/Include/floatobject.h"
#include "third_party/python/Include/import.h"

View file

@ -4,7 +4,6 @@
Python 3
https://docs.python.org/3/license.html │
*/
#include "libc/fmt/fmt.h"
#include "third_party/python/Include/pyctype.h"
#include "third_party/python/Include/pyerrors.h"
#include "third_party/python/Include/pymacro.h"

View file

@ -6,7 +6,6 @@
*/
#define PY_SSIZE_T_CLEAN
#include "libc/assert.h"
#include "libc/fmt/fmt.h"
#include "third_party/python/Include/abstract.h"
#include "third_party/python/Include/boolobject.h"
#include "third_party/python/Include/bytearrayobject.h"

View file

@ -7,7 +7,6 @@
#include "libc/assert.h"
#include "libc/calls/calls.h"
#include "libc/dce.h"
#include "libc/fmt/fmt.h"
#include "libc/intrin/asan.internal.h"
#include "libc/intrin/bits.h"
#include "libc/mem/mem.h"

View file

@ -6,7 +6,6 @@
*/
#include "libc/assert.h"
#include "libc/intrin/likely.h"
#include "libc/fmt/fmt.h"
#include "libc/log/countbranch.h"
#include "third_party/python/Include/abstract.h"
#include "third_party/python/Include/boolobject.h"

View file

@ -8,7 +8,6 @@
#include "third_party/python/Include/unicodeobject.h"
#include "libc/assert.h"
#include "libc/errno.h"
#include "libc/fmt/fmt.h"
#include "libc/intrin/likely.h"
#include "libc/intrin/weaken.h"
#include "libc/log/countbranch.h"

View file

@ -7,7 +7,6 @@
#include "third_party/python/Include/ast.h"
#include "libc/assert.h"
#include "libc/errno.h"
#include "libc/fmt/fmt.h"
#include "third_party/python/Include/Python-ast.h"
#include "third_party/python/Include/abstract.h"
#include "third_party/python/Include/boolobject.h"

View file

@ -5,7 +5,6 @@
https://docs.python.org/3/license.html │
*/
#include "libc/assert.h"
#include "libc/fmt/fmt.h"
#include "third_party/python/Include/pyerrors.h"
/* clang-format off */

View file

@ -6,7 +6,6 @@
*/
#include "libc/assert.h"
#include "libc/errno.h"
#include "libc/fmt/fmt.h"
#include "libc/str/locale.h"
#include "third_party/python/Include/dtoa.h"
#include "third_party/python/Include/object.h"