From 881f6ecb5b5c74fc2823b860fd6b186452af5406 Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Tue, 27 Dec 2022 13:05:30 +0400 Subject: [PATCH] Separate libc and libclayer --- .github/workflows/main.yml | 20 ---------------- Makefile.am | 19 ++++++++++++---- configure.ac | 16 ++++++------- include/Makefile.am | 23 ++++++++++++++----- include/ctype.h | 27 +++++----------------- include/errno.h | 23 +++++-------------- include/inttypes.h | 17 +++++--------- include/libclayer.h | 6 ++--- include/libclayer/ctype.h | 22 ++++++++++++++++++ include/libclayer/errno.h | 18 +++++++++++++++ include/libclayer/inttypes.h | 12 ++++++++++ include/libclayer/setjmp.h | 26 +++++++++++++++++++++ include/libclayer/stdlib.h | 28 +++++++++++++++++++++++ include/libclayer/string.h | 38 +++++++++++++++++++++++++++++++ include/libclayer/sys/types.h | 12 ++++++++++ include/setjmp.h | 31 +++++-------------------- include/stdlib.h | 33 +++++---------------------- include/string.h | 43 +++++------------------------------ include/sys/types.h | 17 +++++--------- make/checks.am | 1 - src/ctype.c | 2 +- src/errno.c | 2 +- src/stdlib.c | 6 ++--- src/string.c | 3 ++- tests/string.c | 3 ++- 25 files changed, 249 insertions(+), 199 deletions(-) create mode 100644 include/libclayer/ctype.h create mode 100644 include/libclayer/errno.h create mode 100644 include/libclayer/inttypes.h create mode 100644 include/libclayer/setjmp.h create mode 100644 include/libclayer/stdlib.h create mode 100644 include/libclayer/string.h create mode 100644 include/libclayer/sys/types.h diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 798f2d3..c3a8a76 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -83,26 +83,6 @@ jobs: - name: install run: sudo make install - cond: - runs-on: ubuntu-latest - strategy: - matrix: - packages: - - without: 'all' - - without: 'io' - steps: - - uses: actions/checkout@v2 - - name: autogen - run: ./autogen.sh - - name: configure - run: ./configure --enable-checks --without-${{matrix.packages.without}} - - name: make - run: make - - name: check - run: make check - - name: install - run: sudo make install - freestanding: runs-on: ubuntu-latest steps: diff --git a/Makefile.am b/Makefile.am index 26e2391..70a8d47 100644 --- a/Makefile.am +++ b/Makefile.am @@ -10,7 +10,18 @@ if ENABLE_CHECKS SUBDIRS += tests endif -lib_LTLIBRARIES = libclayer.la +lib_LTLIBRARIES = + +if ENABLE_LIBCLAYER +lib_LTLIBRARIES += libclayer.la +libclayer_la_SOURCES = $(common_sources) +endif + +if ENABLE_LIBC +lib_LTLIBRARIES += libc.la +libc_la_SOURCES = $(common_sources) +libc_la_CFLAGS = $(AM_CFLAGS) -DLIBCLAYER_NOPREFIX +endif if ENABLE_PKG_CONFIG pkgconfigdir = @pkgconfdir@ @@ -21,7 +32,7 @@ endif # Required files # ################## -libclayer_la_SOURCES = \ +common_sources = \ src/ctype.c \ src/errno.c \ src/libclayer.c \ @@ -29,13 +40,13 @@ libclayer_la_SOURCES = \ src/string.c if ASM_I386 -libclayer_la_SOURCES += \ +common_sources += \ src/asm/i386/longjmp.S \ src/asm/i386/setjmp.S endif if ASM_X86_64 -libclayer_la_SOURCES += \ +common_sources += \ src/asm/x86_64/longjmp.S \ src/asm/x86_64/setjmp.S endif diff --git a/configure.ac b/configure.ac index a8087e2..b5e1583 100644 --- a/configure.ac +++ b/configure.ac @@ -42,7 +42,7 @@ AC_SUBST([PACKAGE_DESCR], ['libc for both hosted and freestanding environments'] dnl Features (enabled by default) AC_ARG_ENABLE([float], AS_HELP_STRING([--disable-float], [disable floating-point arithmetic])) -AC_ARG_ENABLE([prefix], AS_HELP_STRING([--disable-prefix], [disable name prefix])) +AC_ARG_ENABLE([libclayer], AS_HELP_STRING([--disable-libclayer], [install as libclayer])) AC_ARG_ENABLE([werror], AS_HELP_STRING([--disable-werror], [disable -Werror])) dnl Features (disabled by default) @@ -50,6 +50,7 @@ AC_ARG_ENABLE([freestanding], AS_HELP_STRING([--enable-freestanding], [bui AC_ARG_ENABLE([checks], AS_HELP_STRING([--enable-checks], [enable usual tests])) AC_ARG_ENABLE([checks-all], AS_HELP_STRING([--enable-checks-all], [enable all checks])) AC_ARG_ENABLE([checks-cppcheck], AS_HELP_STRING([--enable-checks-cppcheck], [enable cppcheck])) +AC_ARG_ENABLE([libc], AS_HELP_STRING([--enable-libc], [install as libc])) dnl Features (with parameter) AC_ARG_ENABLE([pkg-config], AS_HELP_STRING([--enable-pkg-config@<:@=PATH@:>@], [install pkg-config files @<:@PATH='${libdir}/pkgconfig'@:>@])) @@ -75,7 +76,7 @@ AS_IF([test "$enable_checks_all" = yes], do_enable_checks_all) dnl Features (enabled by default) AS_IF([test "$enable_float" = no ], [enable_float=no], [enable_float=yes]) -AS_IF([test "$enable_prefix" = no ], [enable_prefix=no], [enable_prefix=yes]) +AS_IF([test "$enable_libclayer" = no ], [enable_libclayer=no], [enable_libclayer=yes]) AS_IF([test "$enable_werror" = no ], [enable_werror=no], [enable_werror=yes]) dnl Features (disabled by default) @@ -83,6 +84,7 @@ AS_IF([test "$enable_freestanding" = yes], [enable_freestanding=yes], [ena AS_IF([test "$enable_checks" = yes], [enable_checks=yes], [enable_checks=no]) AS_IF([test "$enable_checks_all" = yes], [enable_checks_all=yes], [enable_checks_all=no]) AS_IF([test "$enable_checks_cppcheck" = yes], [enable_checks_cppcheck=yes], [enable_checks_cppcheck=no]) +AS_IF([test "$enable_libc" = yes], [enable_libc=yes], [enable_libc=no]) dnl Features (with parameter) AS_IF([test "$enable_pkg_config" = yes], [enable_pkg_config='${libdir}/pkgconfig']) @@ -95,7 +97,6 @@ AS_IF([test "$enable_pkg_config" = no ], [enable_pkg_config='']) ############# AS_IF([test "$enable_checks" = yes -a "$enable_freestanding" = yes], AC_MSG_ERROR([can not build freestanding tests])) -AS_IF([test "$enable_checks" = yes -a "$enable_prefix" = no ], AC_MSG_ERROR([can not build tests without prefix])) @@ -113,13 +114,14 @@ AM_CONDITIONAL([ASM_X86], [test "$host_cpu" = i386 -o "$host_cpu" dnl Features (enabled by default) AM_CONDITIONAL([ENABLE_FLOAT], [test "$enable_float" = yes]) -AM_CONDITIONAL([ENABLE_PREFIX], [test "$enable_prefix" = yes]) +AM_CONDITIONAL([ENABLE_LIBCLAYER], [test "$enable_libclayer" = yes]) AM_CONDITIONAL([ENABLE_WERROR], [test "$enable_werror" = yes]) dnl Features (disabled by default) AM_CONDITIONAL([ENABLE_FREESTANDING], [test "$enable_freestanding" = yes]) AM_CONDITIONAL([ENABLE_CHECKS], [test "$enable_checks" = yes]) AM_CONDITIONAL([ENABLE_CHECKS_CPPCHECK], [test "$enable_checks_cppcheck" = yes]) +AM_CONDITIONAL([ENABLE_LIBC], [test "$enable_libc" = yes]) dnl Features (with parameter) AM_CONDITIONAL([ENABLE_PKG_CONFIG], [test ! -z "$enable_pkg_config"]) @@ -141,16 +143,14 @@ AS_IF([test "$host_cpu" = x86_64], [AC_DEFINE([ASM_X86], dnl Features (enabled by default) AS_IF([test "$enable_float" = yes], [AC_DEFINE([ENABLE_FLOAT], [1], [enabled floating-point arithmetic])]) -AS_IF([test "$enable_prefix" = yes], [AC_DEFINE([ENABLE_PREFIX], [1], [enabled prefix])]) +AS_IF([test "$enable_libclayer" = yes], [AC_DEFINE([ENABLE_LIBCLAYER], [1], [install as libclayer])]) AS_IF([test "$enable_werror" = yes], [AC_DEFINE([ENABLE_WERROR], [1], [enabled -Werror])]) dnl Features (disabled by default) AS_IF([test "$enable_freestanding" = yes], [AC_DEFINE([ENABLE_FREESTANDING], [1], [build for freestanding environment])]) AS_IF([test "$enable_checks" = yes], [AC_DEFINE([ENABLE_CHECKS], [1], [enabled usual tests])]) AS_IF([test "$enable_checks_cppcheck" = yes], [AC_DEFINE([ENABLE_CHECKS_CPPCHECK], [1], [enabled cppcheck])]) - -dnl Additional -AS_IF([test "$enable_prefix" = yes], [AC_DEFINE([LIBCLAYER_PREFIX], [libclayer_], [prefix])]) +AS_IF([test "$enable_libc" = yes], [AC_DEFINE([ENABLE_LIBC], [1], [install as libc])]) diff --git a/include/Makefile.am b/include/Makefile.am index 172988f..e77a812 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1,9 +1,20 @@ nobase_include_HEADERS = \ - ctype.h \ - errno.h \ + libclayer.h \ + libclayer/ctype.h \ + libclayer/errno.h \ + libclayer/inttypes.h \ + libclayer/setjmp.h \ + libclayer/stdlib.h \ + libclayer/string.h \ + libclayer/sys/types.h + +if ENABLE_LIBC +nobase_include_HEADERS += \ + ctype.h \ + errno.h \ inttypes.h \ - libclayer.h \ - setjmp.h \ - stdlib.h \ - string.h \ + setjmp.h \ + stdlib.h \ + string.h \ sys/types.h +endif diff --git a/include/ctype.h b/include/ctype.h index df86aab..2441564 100644 --- a/include/ctype.h +++ b/include/ctype.h @@ -1,22 +1,7 @@ -#ifndef _CTYPE_H -#define _CTYPE_H 1 - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -int LIBCLAYER(isdigit)(int c); -int LIBCLAYER(islower)(int c); -int LIBCLAYER(isspace)(int c); -int LIBCLAYER(isupper)(int c); - -int LIBCLAYER(tolower)(int c); -int LIBCLAYER(toupper)(int c); - -#ifdef __cplusplus -} -#endif - +#ifdef LIBCLAYER_NOPREFIX +#include +#else +#define LIBCLAYER_NOPREFIX +#include +#undef LIBCLAYER_NOPREFIX #endif diff --git a/include/errno.h b/include/errno.h index d9927a4..e218745 100644 --- a/include/errno.h +++ b/include/errno.h @@ -1,18 +1,7 @@ -#ifndef _ERRNO_H -#define _ERRNO_H 1 - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#define ERANGE 1 - -extern int LIBCLAYER(errno); - -#ifdef __cplusplus -} -#endif - +#ifdef LIBCLAYER_NOPREFIX +#include +#else +#define LIBCLAYER_NOPREFIX +#include +#undef LIBCLAYER_NOPREFIX #endif diff --git a/include/inttypes.h b/include/inttypes.h index 0e78627..ab4a945 100644 --- a/include/inttypes.h +++ b/include/inttypes.h @@ -1,12 +1,7 @@ -#ifndef _INTTYPES_H -#define _INTTYPES_H 1 - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} -#endif - +#ifdef LIBCLAYER_NOPREFIX +#include +#else +#define LIBCLAYER_NOPREFIX +#include +#undef LIBCLAYER_NOPREFIX #endif diff --git a/include/libclayer.h b/include/libclayer.h index 5342062..3e9f91f 100644 --- a/include/libclayer.h +++ b/include/libclayer.h @@ -7,12 +7,10 @@ extern "C" { #include -#ifndef LIBCLAYER_PREFIX +#ifdef LIBCLAYER_NOPREFIX #define LIBCLAYER(name) name #else -#define LIBCLAYER(name) LIBCLAYER2(LIBCLAYER_PREFIX, name) -#define LIBCLAYER2(prefix, name) LIBCLAYER3(prefix, name) -#define LIBCLAYER3(prefix, name) prefix ## name +#define LIBCLAYER(name) libclayer_ ## name #endif struct Libclayer { diff --git a/include/libclayer/ctype.h b/include/libclayer/ctype.h new file mode 100644 index 0000000..db8702f --- /dev/null +++ b/include/libclayer/ctype.h @@ -0,0 +1,22 @@ +#ifndef _LIBCLAYER_CTYPE_H +#define _LIBCLAYER_CTYPE_H 1 + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +int LIBCLAYER(isdigit)(int c); +int LIBCLAYER(islower)(int c); +int LIBCLAYER(isspace)(int c); +int LIBCLAYER(isupper)(int c); + +int LIBCLAYER(tolower)(int c); +int LIBCLAYER(toupper)(int c); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/libclayer/errno.h b/include/libclayer/errno.h new file mode 100644 index 0000000..16f2a6e --- /dev/null +++ b/include/libclayer/errno.h @@ -0,0 +1,18 @@ +#ifndef _LIBCLAYER_ERRNO_H +#define _LIBCLAYER_ERRNO_H 1 + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +#define ERANGE 1 + +extern int LIBCLAYER(errno); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/libclayer/inttypes.h b/include/libclayer/inttypes.h new file mode 100644 index 0000000..a20dc27 --- /dev/null +++ b/include/libclayer/inttypes.h @@ -0,0 +1,12 @@ +#ifndef _LIBCLAYER_INTTYPES_H +#define _LIBCLAYER_INTTYPES_H 1 + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/libclayer/setjmp.h b/include/libclayer/setjmp.h new file mode 100644 index 0000000..de33e9b --- /dev/null +++ b/include/libclayer/setjmp.h @@ -0,0 +1,26 @@ +#ifndef _LIBCLAYER_SETJMP_H +#define _LIBCLAYER_SETJMP_H 1 + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +// TODO: define in architecture-specific header +typedef unsigned long __jmp_buf[sizeof(long) == 8 ? 8 : 6]; + +typedef struct __jmp_buf_tag { + __jmp_buf __jb; + unsigned long __fl; + unsigned long __ss[128 / sizeof(long)]; +} jmp_buf[1]; + +int LIBCLAYER(setjmp)(jmp_buf env) __attribute__((returns_twice)); +void LIBCLAYER(longjmp)(jmp_buf env, int val) __attribute__((noreturn)); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/libclayer/stdlib.h b/include/libclayer/stdlib.h new file mode 100644 index 0000000..a08b1fc --- /dev/null +++ b/include/libclayer/stdlib.h @@ -0,0 +1,28 @@ +#ifndef _LIBCLAYER_STDLIB_H +#define _LIBCLAYER_STDLIB_H 1 + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + +#define EXIT_SUCCESS 0 +#define EXIT_FAILURE 1 + +int LIBCLAYER(atoi)(const char *str); + +void LIBCLAYER(abort)() __attribute__((noreturn)); +void LIBCLAYER(exit)(int status) __attribute__((noreturn)); + +void *LIBCLAYER(calloc)(size_t nmemb, size_t size); +void LIBCLAYER(free)(void *ptr); +void *LIBCLAYER(malloc)(size_t size); +void *LIBCLAYER(realloc)(void *ptr, size_t size); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/libclayer/string.h b/include/libclayer/string.h new file mode 100644 index 0000000..67e8d6f --- /dev/null +++ b/include/libclayer/string.h @@ -0,0 +1,38 @@ +#ifndef _LIBCLAYER_STRING_H +#define _LIBCLAYER_STRING_H 1 + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + +// mem* +int LIBCLAYER(memcmp)(const void *s1, const void *s2, size_t n); +void *LIBCLAYER(memcpy)(void *dest, const void *src, size_t n); +void *LIBCLAYER(memmove)(void *dest, const void *src, size_t n); +void *LIBCLAYER(memchr)(const void *s, int c, size_t n); +void *LIBCLAYER(memset)(void *s, int c, size_t n); + +// str* +char *LIBCLAYER(strcat)(char *dest, const char *src); +char *LIBCLAYER(strchr)(const char *s, int c); +int LIBCLAYER(strcmp)(const char *s1, const char *s2); +char *LIBCLAYER(strcpy)(char *dest, const char *src); +size_t LIBCLAYER(strlen)(const char *s); + +// strn* +char *LIBCLAYER(strncat)(char *dest, const char *src, size_t n); +int LIBCLAYER(strncmp)(const char *s1, const char *s2, size_t n); +char *LIBCLAYER(strncpy)(char *dest, const char *src, size_t n); +size_t LIBCLAYER(strnlen)(const char *s, size_t maxlen); + +// str* +char *LIBCLAYER(strstr)(const char *haystack, const char *needle); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/libclayer/sys/types.h b/include/libclayer/sys/types.h new file mode 100644 index 0000000..d1bf329 --- /dev/null +++ b/include/libclayer/sys/types.h @@ -0,0 +1,12 @@ +#ifndef _SYS_TYPES_H +#define _SYS_TYPES_H 1 + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/setjmp.h b/include/setjmp.h index 65698b0..e845226 100644 --- a/include/setjmp.h +++ b/include/setjmp.h @@ -1,26 +1,7 @@ -#ifndef _SETJMP_H -#define _SETJMP_H 1 - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -// TODO: define in architecture-specific header -typedef unsigned long __jmp_buf[sizeof(long) == 8 ? 8 : 6]; - -typedef struct __jmp_buf_tag { - __jmp_buf __jb; - unsigned long __fl; - unsigned long __ss[128 / sizeof(long)]; -} jmp_buf[1]; - -int LIBCLAYER(setjmp)(jmp_buf env) __attribute__((returns_twice)); -void LIBCLAYER(longjmp)(jmp_buf env, int val) __attribute__((noreturn)); - -#ifdef __cplusplus -} -#endif - +#ifdef LIBCLAYER_NOPREFIX +#include +#else +#define LIBCLAYER_NOPREFIX +#include +#undef LIBCLAYER_NOPREFIX #endif diff --git a/include/stdlib.h b/include/stdlib.h index 757ff0c..8bb0a6c 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -1,28 +1,7 @@ -#ifndef _STDLIB_H -#define _STDLIB_H 1 - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -#define EXIT_SUCCESS 0 -#define EXIT_FAILURE 1 - -int LIBCLAYER(atoi)(const char *str); - -void LIBCLAYER(abort)() __attribute__((noreturn)); -void LIBCLAYER(exit)(int status) __attribute__((noreturn)); - -void *LIBCLAYER(calloc)(size_t nmemb, size_t size); -void LIBCLAYER(free)(void *ptr); -void *LIBCLAYER(malloc)(size_t size); -void *LIBCLAYER(realloc)(void *ptr, size_t size); - -#ifdef __cplusplus -} -#endif - +#ifdef LIBCLAYER_NOPREFIX +#include +#else +#define LIBCLAYER_NOPREFIX +#include +#undef LIBCLAYER_NOPREFIX #endif diff --git a/include/string.h b/include/string.h index b7d0697..10fda76 100644 --- a/include/string.h +++ b/include/string.h @@ -1,38 +1,7 @@ -#ifndef _STRING_H -#define _STRING_H 1 - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -// mem* -int LIBCLAYER(memcmp)(const void *s1, const void *s2, size_t n); -void *LIBCLAYER(memcpy)(void *dest, const void *src, size_t n); -void *LIBCLAYER(memmove)(void *dest, const void *src, size_t n); -void *LIBCLAYER(memchr)(const void *s, int c, size_t n); -void *LIBCLAYER(memset)(void *s, int c, size_t n); - -// str* -char *LIBCLAYER(strcat)(char *dest, const char *src); -char *LIBCLAYER(strchr)(const char *s, int c); -int LIBCLAYER(strcmp)(const char *s1, const char *s2); -char *LIBCLAYER(strcpy)(char *dest, const char *src); -size_t LIBCLAYER(strlen)(const char *s); - -// strn* -char *LIBCLAYER(strncat)(char *dest, const char *src, size_t n); -int LIBCLAYER(strncmp)(const char *s1, const char *s2, size_t n); -char *LIBCLAYER(strncpy)(char *dest, const char *src, size_t n); -size_t LIBCLAYER(strnlen)(const char *s, size_t maxlen); - -// str* -char *LIBCLAYER(strstr)(const char *haystack, const char *needle); - -#ifdef __cplusplus -} -#endif - +#ifdef LIBCLAYER_NOPREFIX +#include +#else +#define LIBCLAYER_NOPREFIX +#include +#undef LIBCLAYER_NOPREFIX #endif diff --git a/include/sys/types.h b/include/sys/types.h index d1bf329..b7c57c1 100644 --- a/include/sys/types.h +++ b/include/sys/types.h @@ -1,12 +1,7 @@ -#ifndef _SYS_TYPES_H -#define _SYS_TYPES_H 1 - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} -#endif - +#ifdef LIBCLAYER_NOPREFIX +#include +#else +#define LIBCLAYER_NOPREFIX +#include +#undef LIBCLAYER_NOPREFIX #endif diff --git a/make/checks.am b/make/checks.am index 9b49268..2a42c1b 100644 --- a/make/checks.am +++ b/make/checks.am @@ -13,7 +13,6 @@ CPPCHECK_ARGS = \ --error-exitcode=1 \ --std=c99 \ --inline-suppr \ - -ULIBCLAYER_PREFIX \ --enable=warning,style,performance,portability CPPCHECK_INC = \ diff --git a/src/ctype.c b/src/ctype.c index 0fd30af..29204b9 100644 --- a/src/ctype.c +++ b/src/ctype.c @@ -2,7 +2,7 @@ #include "config.h" #endif -#include +#include int LIBCLAYER(isdigit)(const int c) { diff --git a/src/errno.c b/src/errno.c index cbb9687..41ef27f 100644 --- a/src/errno.c +++ b/src/errno.c @@ -2,6 +2,6 @@ #include "config.h" #endif -#include +#include int LIBCLAYER(errno) = 0; diff --git a/src/stdlib.c b/src/stdlib.c index 9e44350..d03c1a3 100644 --- a/src/stdlib.c +++ b/src/stdlib.c @@ -3,11 +3,11 @@ #endif #include +#include +#include +#include -#include #include -#include -#include void LIBCLAYER(exit)(const int status) { diff --git a/src/string.c b/src/string.c index 442334c..7b843b9 100644 --- a/src/string.c +++ b/src/string.c @@ -2,8 +2,9 @@ #include "config.h" #endif +#include + #include -#include int LIBCLAYER(memcmp)(const void *s1, const void *s2, size_t n) { diff --git a/tests/string.c b/tests/string.c index 69c30f9..6654bdf 100644 --- a/tests/string.c +++ b/tests/string.c @@ -1,6 +1,7 @@ +#include + #include #include -#include void test_main() {