libc: Implement functions used by libdrm

This commit is contained in:
Alexander van der Grinten 2017-12-10 20:19:18 +01:00
parent b91a4124cc
commit a4f646d694
5 changed files with 17 additions and 0 deletions

View file

@ -89,6 +89,8 @@
#define PRIxPTR "lx"
#define PRIXPTR "lX"
#define SCNu64 "lu"
#ifdef __cplusplus
extern "C" {
#endif

View file

@ -115,6 +115,9 @@ int getchar_unlocked(void);
int putc_unlocked(int, FILE *);
int putchar_unlocked(int);
// GLIBC extensions.
int asprintf(char **, const char *, ...);
// Linux unlocked I/O extensions.
void clearerr_unlocked(FILE *);

View file

@ -278,6 +278,12 @@ int putchar_unlocked(int) {
__builtin_unreachable();
}
// GLIBC extensions.
int asprintf(char **, const char *, ...) {
__ensure(!"Not implemented");
__builtin_unreachable();
}
// Linux unlocked I/O extensions.
void clearerr_unlocked(FILE *) {

View file

@ -7,6 +7,7 @@ extern "C" {
#endif
char *strdup(const char *string);
char *strndup(const char *, size_t);
#ifdef __cplusplus
}

View file

@ -13,3 +13,8 @@ char *strdup(const char *string) {
return new_string;
}
char *strndup(const char *string, size_t) {
__ensure(!"Not implemented");
__builtin_unreachable();
}