1
0
forked from pool/virtualbox
virtualbox/cxx17.patch

76 lines
3.5 KiB
Diff
Raw Normal View History

2024-09-21 01:53:54 +02:00
From: Jan Engelhardt <ej@inai.de>
Date: 2024-09-20 22:48:58.758026690 +0200
The code uses <filesystem>, so ensure we always use -std=c++17 at the very least.
Prior to C++17, noexcept cannot be part of a type alias, and noexcept is not part of the
function signature. So it was ok that FNCONSUMER *didn't* match the function definition.
In C++17, noexcept is part of the signature, so its absence/presence is significant.
The def file is also wrong, but no one at virtualbox.org noticed for some reason even
though it also caused a link/build failure.
---
Config.kmk | 3 +++
include/iprt/cpp/restclient.h | 12 ++++++++++--
src/VBox/Runtime/VBox/VBoxRTImp-gcc.def | 2 +-
3 files changed, 14 insertions(+), 3 deletions(-)
Index: VirtualBox-7.1.0/Config.kmk
===================================================================
--- VirtualBox-7.1.0.orig/Config.kmk
+++ VirtualBox-7.1.0/Config.kmk
@@ -3093,6 +3093,9 @@ ifeq ($(KBUILD_TARGET),darwin)
endif
endif
endif
+ifndef VBOX_GCC_std
+ VBOX_GCC_std := -std=c++17
+endif
#
# Check for incompatible rpath combinations.
Index: VirtualBox-7.1.0/include/iprt/cpp/restclient.h
===================================================================
--- VirtualBox-7.1.0.orig/include/iprt/cpp/restclient.h
+++ VirtualBox-7.1.0/include/iprt/cpp/restclient.h
@@ -130,7 +130,11 @@ public:
* is the sum of the previously returned @a *pcbActual values.
*/
typedef DECLCALLBACKTYPE(int, FNPRODUCER,(RTCRestBinaryParameter *a_pThis, void *a_pvDst, size_t a_cbDst,
- uint64_t a_offContent, size_t *a_pcbActual)) /*RT_NOEXCEPT*/;
+ uint64_t a_offContent, size_t *a_pcbActual))
+#if defined(__cplusplus) && __cplusplus >= 201700L
+RT_NOEXCEPT
+#endif
+;
/** Pointer to a byte producer callback. */
typedef FNPRODUCER *PFNPRODUCER;
@@ -268,7 +272,11 @@ public:
* is the sum of the previous @a a_cbSrc values.
*/
typedef DECLCALLBACKTYPE(int, FNCONSUMER,(RTCRestBinaryResponse *a_pThis, const void *a_pvSrc, size_t a_cbSrc,
- uint32_t a_uHttpStatus, uint64_t a_offContent, uint64_t a_cbContent)) /*RT_NOEXCEPT*/;
+ uint32_t a_uHttpStatus, uint64_t a_offContent, uint64_t a_cbContent))
+#if defined(__cplusplus) && __cplusplus >= 201700L
+RT_NOEXCEPT
+#endif
+;
/** Pointer to a byte consumer callback. */
typedef FNCONSUMER *PFNCONSUMER;
Index: VirtualBox-7.1.0/src/VBox/Runtime/VBox/VBoxRTImp-gcc.def
===================================================================
--- VirtualBox-7.1.0.orig/src/VBox/Runtime/VBox/VBoxRTImp-gcc.def
+++ VirtualBox-7.1.0/src/VBox/Runtime/VBox/VBoxRTImp-gcc.def
@@ -379,7 +379,7 @@ EXPORTS
_ZN22RTCRestBinaryParameter16xmitHttpCallbackEP14RTHTTPINTERNALPvmyPmS2_ ; int64=llong
_ZN22RTCRestBinaryParameter19setProducerCallbackEPFiPS_PvmmPmES1_m ; before-noexcept int64=long
_ZN22RTCRestBinaryParameter19setProducerCallbackEPFiPS_PvmyPmES1_y ; before-noexcept int64=llong
- _ZN22RTCRestBinaryParameter19setProducerCallbackEPDoFiPS_PvmyPmES1_m ; after-noexcept int64=long
+ _ZN22RTCRestBinaryParameter19setProducerCallbackEPDoFiPS_PvmmPmES1_m ; after-noexcept int64=long
_ZN22RTCRestBinaryParameter19setProducerCallbackEPDoFiPS_PvmyPmES1_y ; after-noexcept int64=llong
_ZN22RTCRestBinaryParameterC1Ev
_ZN22RTCRestBinaryParameterC2Ev