From 8b5cc9cf52bc7de09b9fa2db0f16fced0f4ae2e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Thu, 31 Oct 2024 20:34:19 +0100 Subject: [PATCH] libroot: move memmem for POSIX.1/2024 Change-Id: I1b051586c993cd0e3d43abaa22a3722699f7134e Reviewed-on: https://review.haiku-os.org/c/haiku/+/8517 Tested-by: Commit checker robot Reviewed-by: waddlesplash --- headers/compatibility/gnu/string.h | 31 ------------------- headers/posix/string.h | 2 ++ src/libs/gnu/Jamfile | 1 - src/system/libroot/posix/string/Jamfile | 1 + .../libroot/posix/string}/memmem.c | 0 5 files changed, 3 insertions(+), 32 deletions(-) delete mode 100644 headers/compatibility/gnu/string.h rename src/{libs/gnu => system/libroot/posix/string}/memmem.c (100%) diff --git a/headers/compatibility/gnu/string.h b/headers/compatibility/gnu/string.h deleted file mode 100644 index deedcb4193..0000000000 --- a/headers/compatibility/gnu/string.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2018 Haiku, Inc. All Rights Reserved. - * Distributed under the terms of the MIT License. - */ -#ifndef _GNU_STRING_H_ -#define _GNU_STRING_H_ - - -#include_next -#include - - -#ifdef _DEFAULT_SOURCE - - -#ifdef __cplusplus -extern "C" { -#endif - -extern void *memmem(const void *source, size_t sourceLength, - const void *search, size_t searchLength); - -#ifdef __cplusplus -} -#endif - - -#endif - - -#endif /* _GNU_STRING_H_ */ diff --git a/headers/posix/string.h b/headers/posix/string.h index 79931fd834..7fa188f315 100644 --- a/headers/posix/string.h +++ b/headers/posix/string.h @@ -22,6 +22,8 @@ extern void *memcpy(void *dest, const void *source, size_t length); extern void *memccpy(void *dest, const void *source, int stopByte, size_t length); extern void *memmove(void *dest, const void *source, size_t length); extern void *memset(void *dest, int value, size_t length); +extern void *memmem(const void *source, size_t sourceLength, + const void *search, size_t searchLength); #ifdef _DEFAULT_SOURCE extern void *memrchr(const void *source, int value, size_t length); diff --git a/src/libs/gnu/Jamfile b/src/libs/gnu/Jamfile index d506f3d55e..386de68895 100644 --- a/src/libs/gnu/Jamfile +++ b/src/libs/gnu/Jamfile @@ -17,7 +17,6 @@ for architectureObject in [ MultiArchSubDirSetup ] { SharedLibrary [ MultiArchDefaultGristFiles libgnu.so ] : crypt.cpp - memmem.c qsort.c sched_affinity.cpp sched_getcpu.cpp diff --git a/src/system/libroot/posix/string/Jamfile b/src/system/libroot/posix/string/Jamfile index 4f67a2c887..ffcfd72545 100644 --- a/src/system/libroot/posix/string/Jamfile +++ b/src/system/libroot/posix/string/Jamfile @@ -23,6 +23,7 @@ for architectureObject in [ MultiArchSubDirSetup ] { memccpy.c memchr.c memcmp.c + memmem.c memmove.c stpcpy.c strcasecmp.c diff --git a/src/libs/gnu/memmem.c b/src/system/libroot/posix/string/memmem.c similarity index 100% rename from src/libs/gnu/memmem.c rename to src/system/libroot/posix/string/memmem.c