diff options
Diffstat (limited to 'include/libc-shim')
| -rw-r--r-- | include/libc-shim/bits/alltypes.h | 15 | ||||
| -rw-r--r-- | include/libc-shim/endian.h | 9 | ||||
| -rw-r--r-- | include/libc-shim/features.h | 12 | ||||
| -rw-r--r-- | include/libc-shim/limits.h | 17 | ||||
| -rw-r--r-- | include/libc-shim/stdint.h | 21 | ||||
| -rw-r--r-- | include/libc-shim/string.h | 110 | ||||
| -rw-r--r-- | include/libc-shim/strings.h | 40 |
7 files changed, 0 insertions, 224 deletions
diff --git a/include/libc-shim/bits/alltypes.h b/include/libc-shim/bits/alltypes.h deleted file mode 100644 index cf21a5e..0000000 --- a/include/libc-shim/bits/alltypes.h +++ /dev/null @@ -1,15 +0,0 @@ -/* Shim: provide types musl string functions need */ -#ifndef _BITS_ALLTYPES_H -#define _BITS_ALLTYPES_H - -#ifndef __cplusplus -typedef unsigned long size_t; -#endif - -typedef long ssize_t; -typedef unsigned long uintptr_t; - -/* locale_t stub — unused in kernel, but declared by some headers */ -typedef void *locale_t; - -#endif diff --git a/include/libc-shim/endian.h b/include/libc-shim/endian.h deleted file mode 100644 index 8346386..0000000 --- a/include/libc-shim/endian.h +++ /dev/null @@ -1,9 +0,0 @@ -/* Shim: endianness for musl string functions */ -#ifndef _ENDIAN_H -#define _ENDIAN_H - -#define __LITTLE_ENDIAN 1234 -#define __BIG_ENDIAN 4321 -#define __BYTE_ORDER __LITTLE_ENDIAN /* RISC-V is LE */ - -#endif diff --git a/include/libc-shim/features.h b/include/libc-shim/features.h deleted file mode 100644 index a3466c8..0000000 --- a/include/libc-shim/features.h +++ /dev/null @@ -1,12 +0,0 @@ -/* Shim: musl expects this header */ -#ifndef _FEATURES_H -#define _FEATURES_H - -/* weak_alias: musl uses this for symbol aliasing (e.g. __memrchr -> memrchr) */ -#define weak_alias(old, new) \ - extern __typeof(old) new __attribute__((__weak__, __alias__(#old))) - -/* hidden attribute used by some musl sources */ -#define hidden __attribute__((__visibility__("hidden"))) - -#endif diff --git a/include/libc-shim/limits.h b/include/libc-shim/limits.h deleted file mode 100644 index a1d546e..0000000 --- a/include/libc-shim/limits.h +++ /dev/null @@ -1,17 +0,0 @@ -/* Shim: limits for musl string functions (memmem uses SIZE_MAX) */ -#ifndef _LIMITS_H -#define _LIMITS_H - -#define CHAR_BIT 8 -#define UCHAR_MAX 255 -#define SCHAR_MAX 127 -#define SCHAR_MIN (-128) -#define INT_MAX 2147483647 -#define INT_MIN (-INT_MAX - 1) -#define UINT_MAX 4294967295U -#define LONG_MAX 9223372036854775807L -#define LONG_MIN (-LONG_MAX - 1L) -#define ULONG_MAX 18446744073709551615UL -#define SIZE_MAX ULONG_MAX - -#endif diff --git a/include/libc-shim/stdint.h b/include/libc-shim/stdint.h deleted file mode 100644 index 650bdcf..0000000 --- a/include/libc-shim/stdint.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Shim: stdint types for musl string functions */ -#ifndef _STDINT_H -#define _STDINT_H - -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; -typedef unsigned long uint64_t; -typedef signed char int8_t; -typedef signed short int16_t; -typedef signed int int32_t; -typedef signed long int64_t; -typedef unsigned long uintptr_t; -typedef long intptr_t; - -#define UINT8_MAX 0xFF -#define UINT16_MAX 0xFFFF -#define UINT32_MAX 0xFFFFFFFFU -#define UINT64_MAX 0xFFFFFFFFFFFFFFFFUL - -#endif diff --git a/include/libc-shim/string.h b/include/libc-shim/string.h deleted file mode 100644 index 8a86304..0000000 --- a/include/libc-shim/string.h +++ /dev/null @@ -1,110 +0,0 @@ -#ifndef _STRING_H -#define _STRING_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include <features.h> - -#if __cplusplus >= 201103L -#define NULL nullptr -#elif defined(__cplusplus) -#define NULL 0L -#else -#define NULL ((void*)0) -#endif - -#define __NEED_size_t -#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ - || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ - || defined(_BSD_SOURCE) -#define __NEED_locale_t -#endif - -#include <bits/alltypes.h> - -void *memcpy (void *__restrict, const void *__restrict, size_t); -void *memmove (void *, const void *, size_t); -void *memset (void *, int, size_t); -int memcmp (const void *, const void *, size_t); -void *memchr (const void *, int, size_t); - -char *strcpy (char *__restrict, const char *__restrict); -char *strncpy (char *__restrict, const char *__restrict, size_t); - -char *strcat (char *__restrict, const char *__restrict); -char *strncat (char *__restrict, const char *__restrict, size_t); - -int strcmp (const char *, const char *); -int strncmp (const char *, const char *, size_t); - -int strcoll (const char *, const char *); -size_t strxfrm (char *__restrict, const char *__restrict, size_t); - -char *strchr (const char *, int); -char *strrchr (const char *, int); - -size_t strcspn (const char *, const char *); -size_t strspn (const char *, const char *); -char *strpbrk (const char *, const char *); -char *strstr (const char *, const char *); -char *strtok (char *__restrict, const char *__restrict); - -size_t strlen (const char *); - -char *strerror (int); - -#if defined(_BSD_SOURCE) || defined(_GNU_SOURCE) -#include <strings.h> -#endif - -#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ - || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ - || defined(_BSD_SOURCE) -char *strtok_r (char *__restrict, const char *__restrict, char **__restrict); -int strerror_r (int, char *, size_t); -char *stpcpy(char *__restrict, const char *__restrict); -char *stpncpy(char *__restrict, const char *__restrict, size_t); -size_t strnlen (const char *, size_t); -char *strdup (const char *); -char *strndup (const char *, size_t); -char *strsignal(int); -char *strerror_l (int, locale_t); -int strcoll_l (const char *, const char *, locale_t); -size_t strxfrm_l (char *__restrict, const char *__restrict, size_t, locale_t); -void *memmem(const void *, size_t, const void *, size_t); -#endif - -#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ - || defined(_BSD_SOURCE) -void *memccpy (void *__restrict, const void *__restrict, int, size_t); -#endif - -#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) -char *strsep(char **, const char *); -size_t strlcat (char *, const char *, size_t); -size_t strlcpy (char *, const char *, size_t); -void explicit_bzero (void *, size_t); -#endif - -#ifdef _GNU_SOURCE -#define strdupa(x) strcpy(alloca(strlen(x)+1),x) -int strverscmp (const char *, const char *); -char *strchrnul(const char *, int); -char *strcasestr(const char *, const char *); -void *memrchr(const void *, int, size_t); -void *mempcpy(void *, const void *, size_t); -#endif - -/* musl internal symbols used across translation units */ -char *__strchrnul(const char *, int); -void *__memrchr(const void *, int, size_t); -char *__stpcpy(char *__restrict, const char *__restrict); -char *__stpncpy(char *__restrict, const char *__restrict, size_t); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/include/libc-shim/strings.h b/include/libc-shim/strings.h deleted file mode 100644 index b7a5ea0..0000000 --- a/include/libc-shim/strings.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef _STRINGS_H -#define _STRINGS_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include <features.h> - -#define __NEED_size_t -#define __NEED_locale_t -#include <bits/alltypes.h> - -#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) || defined(_POSIX_SOURCE) \ - || (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE+0 < 200809L) \ - || (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE+0 < 700) -int bcmp (const void *, const void *, size_t); -void bcopy (const void *, void *, size_t); -void bzero (void *, size_t); -char *index (const char *, int); -char *rindex (const char *, int); -#endif - -#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) -int ffs (int); -int ffsl (long); -int ffsll (long long); -#endif - -int strcasecmp (const char *, const char *); -int strncasecmp (const char *, const char *, size_t); - -int strcasecmp_l (const char *, const char *, locale_t); -int strncasecmp_l (const char *, const char *, size_t, locale_t); - -#ifdef __cplusplus -} -#endif - -#endif |
