git: de862b33d480 - main - emulators/virtualbox-ose: fix build errors on CURRENT

From: Corvin Köhne <corvink_at_FreeBSD.org>
Date: Tue, 12 Sep 2023 12:00:19 UTC
The branch main has been updated by corvink:

URL: https://cgit.FreeBSD.org/ports/commit/?id=de862b33d480559301360c44d840ae12ee4bcfb4

commit de862b33d480559301360c44d840ae12ee4bcfb4
Author:     Kurosawa Takahiro <takahiro.kurosawa@gmail.com>
AuthorDate: 2023-09-12 11:55:04 +0000
Commit:     Corvin Köhne <corvink@FreeBSD.org>
CommitDate: 2023-09-12 12:00:14 +0000

    emulators/virtualbox-ose: fix build errors on CURRENT
    
    PR:                     272991
    Reviewed by:            corvink, manu
    Approved by:            manu, vbox (maintainer timeout)
---
 emulators/virtualbox-ose-additions/Makefile                    |  2 ++
 .../files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs.h   | 10 ++++++++--
 .../patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vfsops.c |  2 +-
 .../patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vnops.c  |  2 +-
 4 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/emulators/virtualbox-ose-additions/Makefile b/emulators/virtualbox-ose-additions/Makefile
index 609337173458..6a2e8cbd2916 100644
--- a/emulators/virtualbox-ose-additions/Makefile
+++ b/emulators/virtualbox-ose-additions/Makefile
@@ -99,6 +99,8 @@ post-patch:
 	@${ECHO_CMD} 'VBOX_WITH_X11_ADDITIONS = ${VBOX_WITH_X11}' >> \
 	    ${WRKSRC}/LocalConfig.kmk
 	@${ECHO_CMD} 'VBOX_GCC_std = -std=c++11' >> ${WRKSRC}/LocalConfig.kmk
+	@${ECHO_CMD} 'CXXDEFS += _LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR' >> \
+	    ${WRKSRC}/LocalConfig.kmk
 .if ${COMPILER_TYPE} == clang
 	@${REINPLACE_CMD} -e 's| -finline-limit=8000||' \
 	    -e 's| -fno-merge-constants||' \
diff --git a/emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs.h b/emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs.h
index a4f94f92e148..3551533f2bcd 100644
--- a/emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs.h
+++ b/emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs.h
@@ -9,7 +9,7 @@
  /*
   * Copyright (C) 2010-2020 Oracle Corporation
   *
-@@ -24,72 +19,371 @@
+@@ -24,72 +19,377 @@
  #define VBOXVFS_VFSNAME "vboxvfs"
  #define VBOXVFS_VERSION 1
  
@@ -134,6 +134,12 @@
 -    int             didrele;
 +#include <VBox/VBoxGuestLibSharedFolders.h>
 +
++#if __FreeBSD_version >= 1400093
++typedef __enum_uint8(vtype) enum_vtype_t;
++#else
++typedef enum vtype enum_vtype_t;
++#endif
++
 +#define	VBOXVFS_DEBUG(lvl, ...)	do {					\
 +	if (vboxvfs_debug >= (lvl)) {					\
 +		printf("VBOXVFS[%u]: ", lvl);				\
@@ -323,7 +329,7 @@
 +void vboxfs_free_vp(struct vnode *);
 +
 +int vboxfs_alloc_node(struct mount *, struct vboxfs_mnt *, const char*,
-+    enum vtype, uid_t, gid_t, mode_t, struct vboxfs_node *,
++    enum_vtype_t, uid_t, gid_t, mode_t, struct vboxfs_node *,
 +    struct vboxfs_node **);
 +void vboxfs_free_node(struct vboxfs_mnt *, struct vboxfs_node *);
 +
diff --git a/emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vfsops.c b/emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vfsops.c
index c37baa13efc4..be9d416aa3bf 100644
--- a/emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vfsops.c
+++ b/emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vfsops.c
@@ -130,7 +130,7 @@
 + */
 +int
 +vboxfs_alloc_node(struct mount *mp, struct vboxfs_mnt *vsfmp, const char *fullpath,
-+    enum vtype type, uid_t uid, gid_t gid, mode_t mode, struct vboxfs_node *parent,
++    enum_vtype_t type, uid_t uid, gid_t gid, mode_t mode, struct vboxfs_node *parent,
 +    struct vboxfs_node **node)
  {
 -    struct vboxvfs_mount_info args;
diff --git a/emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vnops.c b/emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vnops.c
index b2f56a2bbd28..d0da1fbf3f45 100644
--- a/emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vnops.c
+++ b/emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vnops.c
@@ -420,7 +420,7 @@
 + */
 +static int
 +vboxfs_alloc_file(struct vboxfs_mnt *vboxfsmp, const char *fullpath,
-+    enum vtype type, mode_t mode, struct vboxfs_node *parent,
++    enum_vtype_t type, mode_t mode, struct vboxfs_node *parent,
 +    int lkflag, struct vnode **vpp)
  {
 -    return 0;