mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-28 15:28:30 +00:00
Fix bugs in cosmocc toolchain
This change integrates e58abc1110b335a3341e8ad5821ad8e3880d9bb2 from https://github.com/ahgamut/musl-cross-make/ which fixes the issues we were having with our C language extension for symbolic constants. This change also performs some code cleanup and bug fixes to getaddrinfo(). It's now possible to compile projects like ncurses, readline and python without needing to patch anything upstream, except maybe a line or two. Pretty soon it should be possible to build a Linux distro on Cosmo.
This commit is contained in:
parent
22f81a8d50
commit
23e235b7a5
272 changed files with 3491 additions and 4350 deletions
23
libc/zip.h
23
libc/zip.h
|
@ -1,7 +1,7 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_ZIP_H_
|
||||
#define COSMOPOLITAN_LIBC_ZIP_H_
|
||||
#include "libc/intrin/bits.h"
|
||||
#include "libc/calls/struct/timespec.h"
|
||||
#include "libc/intrin/bits.h"
|
||||
#include "libc/macros.internal.h"
|
||||
#include "libc/str/str.h"
|
||||
|
||||
|
@ -9,6 +9,21 @@
|
|||
* @fileoverview PKZIP Data Structures.
|
||||
*/
|
||||
|
||||
#define kZipOk 0
|
||||
#define kZipErrorEocdNotFound -1
|
||||
#define kZipErrorEocdOffsetOverflow -2
|
||||
#define kZipErrorEocdMagicNotFound -3
|
||||
#define kZipErrorEocdSizeOverflow -4
|
||||
#define kZipErrorEocdDiskMismatch -5
|
||||
#define kZipErrorCdirRecordsMismatch -6
|
||||
#define kZipErrorCdirRecordsOverflow -7
|
||||
#define kZipErrorCdirOffsetPastEocd -8
|
||||
#define kZipErrorCdirLocatorMagic -9
|
||||
#define kZipErrorCdirLocatorOffset -10
|
||||
#define kZipErrorRaceCondition -11
|
||||
#define kZipErrorMapFailed -12
|
||||
#define kZipErrorOpenFailed -13
|
||||
|
||||
#define kZipAlign 2
|
||||
|
||||
#define kZipCosmopolitanVersion kZipEra2001
|
||||
|
@ -184,10 +199,10 @@
|
|||
#define ZIP_EXTRA_CONTENT(P) ((P) + 4)
|
||||
#define ZIP_EXTRA_SIZE(P) (ZIP_EXTRA_CONTENTSIZE(P) + kZipExtraHdrSize)
|
||||
|
||||
void *GetZipCdir(const uint8_t *, size_t);
|
||||
void *GetZipEocd(const uint8_t *, size_t, int *);
|
||||
uint8_t *FindEmbeddedApe(const uint8_t *, size_t);
|
||||
bool IsZipCdir32(const uint8_t *, size_t, size_t);
|
||||
bool IsZipCdir64(const uint8_t *, size_t, size_t);
|
||||
int IsZipEocd32(const uint8_t *, size_t, size_t);
|
||||
int IsZipEocd64(const uint8_t *, size_t, size_t);
|
||||
int GetZipCfileMode(const uint8_t *);
|
||||
uint64_t GetZipCdirOffset(const uint8_t *);
|
||||
uint64_t GetZipCdirRecords(const uint8_t *);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue