From 7a30314ca2b6d7cf9564004d5550110cf49e9c7b Mon Sep 17 00:00:00 2001
From: Bruno Haible <bruno@clisp.org>
Date: Mon, 4 Jan 2021 07:58:03 +0100
Subject: [PATCH] ssfmalloc: Fix includes.

* lib/ssfmalloc.h: Include <strings.h>, for ffs().
* tests/test-ssfmalloc.c: Include <string.h>, for memset().
---
 ChangeLog              | 6 ++++++
 lib/ssfmalloc.h        | 3 ++-
 tests/test-ssfmalloc.c | 1 +
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index c2e48a7b4f..6f42f1ccc5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2021-01-04  Bruno Haible  <bruno@clisp.org>
+
+	ssfmalloc: Fix includes.
+	* lib/ssfmalloc.h: Include <strings.h>, for ffs().
+	* tests/test-ssfmalloc.c: Include <string.h>, for memset().
+
 2021-01-03  Bruno Haible  <bruno@clisp.org>
 
 	quotearg tests: Avoid test failures on Solaris 11.3.
diff --git a/lib/ssfmalloc.h b/lib/ssfmalloc.h
index d5e0a1eb9f..8fdb2b14a6 100644
--- a/lib/ssfmalloc.h
+++ b/lib/ssfmalloc.h
@@ -121,7 +121,8 @@ static void free_block (uintptr_t block);
  */
 
 #include <stdlib.h>
-#include <string.h>
+#include <string.h>     /* ffsll */
+#include <strings.h>    /* ffs */
 #include "flexmember.h"
 #include "glthread/lock.h"
 #include "thread-optim.h"
diff --git a/tests/test-ssfmalloc.c b/tests/test-ssfmalloc.c
index 640071de5e..6571cedd96 100644
--- a/tests/test-ssfmalloc.c
+++ b/tests/test-ssfmalloc.c
@@ -142,6 +142,7 @@ free_pages (uintptr_t pages, size_t size)
 /* ================================= Tests ================================= */
 
 #include <limits.h>
+#include <string.h>
 
 #include "macros.h"
 
-- 
2.39.5