mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-09-10 10:43:48 +00:00
Get LIBC_MEM and LIBC_STDIO building with aarch64
This commit is contained in:
parent
ae0ee59614
commit
d04430f4ef
81 changed files with 440 additions and 1064 deletions
|
@ -16,13 +16,13 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "tool/build/lib/interner.h"
|
||||
#include "libc/intrin/safemacros.internal.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/nexgen32e/crc32.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/x/x.h"
|
||||
#include "tool/build/lib/interner.h"
|
||||
|
||||
#define kInitialItems 16
|
||||
|
||||
|
@ -50,7 +50,7 @@ static void rehash(struct InternerObject *it) {
|
|||
} while (it->p[j].hash);
|
||||
memcpy(&it->p[j], &p[i], sizeof(p[i]));
|
||||
}
|
||||
free_s(&p);
|
||||
free(p);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -114,7 +114,7 @@ void GetOpts(int argc, char *argv[]) {
|
|||
test_ = true;
|
||||
break;
|
||||
case 'o':
|
||||
fclose_s(&fout_);
|
||||
fclose(fout_);
|
||||
if (!(fout_ = fopen((hint_ = optarg), "w"))) {
|
||||
PrintIoErrorMessage();
|
||||
exit(1);
|
||||
|
@ -191,9 +191,11 @@ int Run(char **paths, size_t count) {
|
|||
hint_ = "/dev/stdin";
|
||||
if (!fout_) fout_ = stdout;
|
||||
rc = RunLengthCode();
|
||||
rc |= fclose_s(&fin_);
|
||||
rc |= fclose(fin_);
|
||||
fin_ = 0;
|
||||
} else {
|
||||
rc = fclose_s(&fin_);
|
||||
rc = fclose(fin_);
|
||||
fin_ = 0;
|
||||
for (i = 0; i < count && rc != -1; ++i) {
|
||||
rc = -1;
|
||||
if ((fin_ = fopen((hint_ = paths[i]), "r"))) {
|
||||
|
@ -219,18 +221,21 @@ int Run(char **paths, size_t count) {
|
|||
if (rc != -1 && !decompress_) {
|
||||
rc = RunLengthEncode2();
|
||||
}
|
||||
if ((rc |= fclose_s(&fout_)) != -1) {
|
||||
if ((rc |= fclose(fout_)) != -1) {
|
||||
unlink(paths[i]);
|
||||
}
|
||||
fout_ = 0;
|
||||
}
|
||||
}
|
||||
rc |= fclose_s(&fin_);
|
||||
rc |= fclose(fin_);
|
||||
fin_ = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (rc != -1 && fout_) {
|
||||
rc = RunLengthEncode2();
|
||||
rc |= fclose_s(&fout_);
|
||||
rc |= fclose(fout_);
|
||||
fout_ = 0;
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue