diff --git a/Libraries/LibC/bits/stdint.h b/Libraries/LibC/bits/stdint.h index 8e1fbcba4d..4fc2865904 100644 --- a/Libraries/LibC/bits/stdint.h +++ b/Libraries/LibC/bits/stdint.h @@ -101,6 +101,15 @@ typedef __INTMAX_TYPE__ intmax_t; #define UINT_LEAST32_MAX UINT32_MAX #define UINT_LEAST64_MAX UINT64_MAX +#define INT8_C(x) x +#define UINT8_C(x) x + +#define INT16_C(x) x +#define UINT16_C(x) x + +#define INT32_C(x) x +#define UINT32_C(x) x + #define INT64_C(x) x##LL #define UINT64_C(x) x##ULL diff --git a/Libraries/LibC/inttypes.h b/Libraries/LibC/inttypes.h index 7f27521caa..fb6b932765 100644 --- a/Libraries/LibC/inttypes.h +++ b/Libraries/LibC/inttypes.h @@ -17,7 +17,9 @@ #define PRIx8 "b" #define PRIx16 "w" #define PRIx32 "x" +#define PRIX32 "X" #define PRIx64 "llx" +#define PRIX64 "llX" #define __PRI64_PREFIX "ll" #define __PRIPTR_PREFIX diff --git a/Libraries/LibC/stdio.cpp b/Libraries/LibC/stdio.cpp index ae9872c877..7a1cdc9069 100644 --- a/Libraries/LibC/stdio.cpp +++ b/Libraries/LibC/stdio.cpp @@ -437,7 +437,9 @@ void perror(const char* s) FILE* fopen(const char* pathname, const char* mode) { int flags = 0; - if (!strcmp(mode, "r") || !strcmp(mode, "rb")) + // NOTE: rt is a non-standard mode which opens a file for read, explicitly + // specifying that it's a text file + if (!strcmp(mode, "r") || !strcmp(mode, "rb") || !strcmp(mode, "rt")) flags = O_RDONLY; else if (!strcmp(mode, "r+") || !strcmp(mode, "rb+")) flags = O_RDWR; diff --git a/Libraries/LibC/stdio.h b/Libraries/LibC/stdio.h index 18214fb0e8..dd71933720 100644 --- a/Libraries/LibC/stdio.h +++ b/Libraries/LibC/stdio.h @@ -7,6 +7,7 @@ #include #include +#define FILENAME_MAX 1024 #define BUFSIZ 1024 __BEGIN_DECLS diff --git a/Libraries/LibC/time.cpp b/Libraries/LibC/time.cpp index 8a301b3bb5..cdc48f0f08 100644 --- a/Libraries/LibC/time.cpp +++ b/Libraries/LibC/time.cpp @@ -4,6 +4,7 @@ #include #include #include +#include extern "C" { @@ -96,9 +97,11 @@ char* asctime(const struct tm*) ASSERT_NOT_REACHED(); } -size_t strftime(char*, size_t, const char*, const struct tm*) +size_t strftime(char* destination, size_t, const char*, const struct tm*) { - ASSERT_NOT_REACHED(); + // FIXME: Stubbed function to make nasm work. Should be properly implemented + strcpy(destination, "strftime_unimplemented"); + return strlen("strftime_unimplemented"); } long timezone;