diff mbox series

[committed] libstdc++: Fix declaration of posix_memalign for freestanding

Message ID 20240614143914.1357117-1-jwakely@redhat.com
State New
Headers show
Series [committed] libstdc++: Fix declaration of posix_memalign for freestanding | expand

Commit Message

Jonathan Wakely June 14, 2024, 2:38 p.m. UTC
Tested x86_64-linux with --disable-hosted-libstdcxx where it is needed
to fix the build.

Pushed to trunk, backports needed too.

-- >8 --

Thanks to Jérôme Duval for noticing this.

libstdc++-v3/ChangeLog:

	* libsupc++/new_opa.cc [!_GLIBCXX_HOSTED]: Fix declaration of
	posix_memalign.
---
 libstdc++-v3/libsupc++/new_opa.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libstdc++-v3/libsupc++/new_opa.cc b/libstdc++-v3/libsupc++/new_opa.cc
index 35606e1c1b3..c7c7e794623 100644
--- a/libstdc++-v3/libsupc++/new_opa.cc
+++ b/libstdc++-v3/libsupc++/new_opa.cc
@@ -47,7 +47,7 @@  using std::size_t;
 extern "C"
 {
 # if _GLIBCXX_HAVE_POSIX_MEMALIGN
-  void *posix_memalign(void **, size_t alignment, size_t size);
+  int posix_memalign(void **, size_t alignment, size_t size);
 # elif _GLIBCXX_HAVE_ALIGNED_ALLOC
   void *aligned_alloc(size_t alignment, size_t size);
 # elif _GLIBCXX_HAVE__ALIGNED_MALLOC