[haiku-commits] haiku: hrev52157 - src/libs/compat/freebsd11_network/compat/sys headers/private/kernel/util src/system/kernel/util

  • From: waddlesplash <waddlesplash@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 1 Aug 2018 23:43:00 -0400 (EDT)

hrev52157 adds 2 changesets to branch 'master'
old head: a31d07a2a9d1aee9b9bb04f6bf2a5829f5d92960
new head: edb6d3b17b6617314ad58fc82e61752378b08574
overview: 
https://git.haiku-os.org/haiku/log/?qt=range&q=edb6d3b17b66+%5Ea31d07a2a9d1

----------------------------------------------------------------------------

cf36277e17d7: freebsd11_network: Add definition of ALIGNED_POINTER for PowerPC.
  
  It seems this is needed anyway, as netresolv uses these headers.

edb6d3b17b66: kernel_cpp: Move the C++14 operator delete out of the header.
  
  It seems not all of the kernel includes this, but some use new/delete
  anyway. Further, operator delete[] was not implemented at all.
  
  Possibly fixes the ARM build.

                              [ Augustin Cavalier <waddlesplash@xxxxxxxxx> ]

----------------------------------------------------------------------------

3 files changed, 24 insertions(+), 10 deletions(-)
headers/private/kernel/util/kernel_cpp.h          |  9 ++-------
.../compat/freebsd11_network/compat/sys/param.h   |  6 +++---
src/system/kernel/util/kernel_cpp.cpp             | 19 +++++++++++++++++++

############################################################################

Commit:      cf36277e17d709e88ccdf5436d1e359ed645302d
URL:         https://git.haiku-os.org/haiku/commit/?id=cf36277e17d7
Author:      Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date:        Thu Aug  2 03:23:21 2018 UTC

freebsd11_network: Add definition of ALIGNED_POINTER for PowerPC.

It seems this is needed anyway, as netresolv uses these headers.

----------------------------------------------------------------------------

diff --git a/src/libs/compat/freebsd11_network/compat/sys/param.h 
b/src/libs/compat/freebsd11_network/compat/sys/param.h
index 336ad4cbcd..ece83e2ff8 100644
--- a/src/libs/compat/freebsd11_network/compat/sys/param.h
+++ b/src/libs/compat/freebsd11_network/compat/sys/param.h
@@ -49,10 +49,10 @@
 #define ALIGN_BYTES            (sizeof(unsigned long) - 1)
 #define ALIGN(x)               ((((unsigned long)x) + ALIGN_BYTES) & 
~ALIGN_BYTES)
 
-#ifdef __x86_64__
-#define        ALIGNED_POINTER(p, t)   1
-#elif defined(__i386__)
+#if defined(__x86_64__) || defined(__i386__)
 #define        ALIGNED_POINTER(p, t)   1
+#elif defined(__powerpc__)
+#define        ALIGNED_POINTER(p, t)   ((((uintptr_t)(p)) & (sizeof (t) - 1)) 
== 0)
 #else
 #error Need definition of ALIGNED_POINTER for this arch!
 #endif

############################################################################

Revision:    hrev52157
Commit:      edb6d3b17b6617314ad58fc82e61752378b08574
URL:         https://git.haiku-os.org/haiku/commit/?id=edb6d3b17b66
Author:      Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date:        Thu Aug  2 03:42:24 2018 UTC

kernel_cpp: Move the C++14 operator delete out of the header.

It seems not all of the kernel includes this, but some use new/delete
anyway. Further, operator delete[] was not implemented at all.

Possibly fixes the ARM build.

----------------------------------------------------------------------------

diff --git a/headers/private/kernel/util/kernel_cpp.h 
b/headers/private/kernel/util/kernel_cpp.h
index d904b16154..4709db51a4 100644
--- a/headers/private/kernel/util/kernel_cpp.h
+++ b/headers/private/kernel/util/kernel_cpp.h
@@ -39,13 +39,8 @@ extern void operator delete(void *ptr) _NOEXCEPT;
 extern void operator delete[](void *ptr) _NOEXCEPT;
 
 #if __cplusplus >= 201402L
-
-inline void
-operator delete(void *ptr, size_t size) throw ()
-{
-       free(ptr);
-}
-
+extern void operator delete(void* ptr, std::size_t) _NOEXCEPT;
+extern void operator delete[](void* ptr, std::size_t) _NOEXCEPT;
 #endif // __cplusplus >= 201402L
 
 #endif // #if _KERNEL_MODE
diff --git a/src/system/kernel/util/kernel_cpp.cpp 
b/src/system/kernel/util/kernel_cpp.cpp
index 10a5261ac0..4c064acb43 100644
--- a/src/system/kernel/util/kernel_cpp.cpp
+++ b/src/system/kernel/util/kernel_cpp.cpp
@@ -141,6 +141,25 @@ operator delete[](void *ptr) _NOEXCEPT
        free(ptr);
 }
 
+
+#if __cplusplus >= 201402L
+
+void
+operator delete(void* ptr, std::size_t) _NOEXCEPT
+{
+       free(ptr);
+}
+
+
+void
+operator delete[](void* ptr, std::size_t) _NOEXCEPT
+{
+       free(ptr);
+}
+
+#endif
+
+
 #ifndef _BOOT_MODE
 
 FILE *stderr = NULL;


Other related posts:

  • » [haiku-commits] haiku: hrev52157 - src/libs/compat/freebsd11_network/compat/sys headers/private/kernel/util src/system/kernel/util - waddlesplash