From: Katy Feng Date: Thu, 5 Oct 2023 17:35:26 +0000 (-0700) Subject: Update Glib header inclusion to address C++ compatibility issues. X-Git-Tag: stable-12.4.0~97 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e367c428ff4062517228171ea63359fdbe252e66;p=thirdparty%2Fopen-vm-tools.git Update Glib header inclusion to address C++ compatibility issues. --- diff --git a/open-vm-tools/lib/include/vmware/tools/gdp.h b/open-vm-tools/lib/include/vmware/tools/gdp.h index edf135fb2..c071cd532 100644 --- a/open-vm-tools/lib/include/vmware/tools/gdp.h +++ b/open-vm-tools/lib/include/vmware/tools/gdp.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (c) 2020-2021 VMware, Inc. All rights reserved. + * Copyright (c) 2020-2021,2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -25,7 +25,19 @@ * Public interface of the "gdp" plugin service. */ +/* + * glib-object.h should not be placed inside `extern "C"' blocks. + * However, this header is often placed inside such blocks. + * Here we change back into C++ for glib-object.h + */ +#ifdef __cplusplus +extern "C++" { +#endif #include +#ifdef __cplusplus +} +#endif + #include "vmware/tools/plugin.h" /* diff --git a/open-vm-tools/lib/include/vmware/tools/guestStore.h b/open-vm-tools/lib/include/vmware/tools/guestStore.h index 0552e43d8..f099f83a6 100644 --- a/open-vm-tools/lib/include/vmware/tools/guestStore.h +++ b/open-vm-tools/lib/include/vmware/tools/guestStore.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (c) 2020 VMware, Inc. All rights reserved. + * Copyright (c) 2020,2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -28,7 +28,19 @@ * @{ */ +/* + * glib-object.h should not be placed inside `extern "C"' blocks. + * However, this header is often placed inside such blocks. + * Here we change back into C++ for glib-object.h + */ +#ifdef __cplusplus +extern "C++" { +#endif #include +#ifdef __cplusplus +} +#endif + #include "vmware/tools/plugin.h" /** diff --git a/open-vm-tools/lib/include/vmware/tools/guestrpc.h b/open-vm-tools/lib/include/vmware/tools/guestrpc.h index 667023b7f..e8779b5fa 100644 --- a/open-vm-tools/lib/include/vmware/tools/guestrpc.h +++ b/open-vm-tools/lib/include/vmware/tools/guestrpc.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2008,2014-2016,2018-2020 VMware, Inc. All rights reserved. + * Copyright (C) 2008,2014-2016,2018-2020,2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -36,7 +36,19 @@ * @{ */ +/* + * glib.h should not be placed inside `extern "C"' blocks. + * However, this header is often placed inside such blocks. + * Here we change back into C++ for glib.h + */ +#ifdef __cplusplus +extern "C++" { +#endif #include +#ifdef __cplusplus +} +#endif + #include "vmware/tools/utils.h" G_BEGIN_DECLS diff --git a/open-vm-tools/lib/include/vmware/tools/plugin.h b/open-vm-tools/lib/include/vmware/tools/plugin.h index f8013f8c0..91c74e181 100644 --- a/open-vm-tools/lib/include/vmware/tools/plugin.h +++ b/open-vm-tools/lib/include/vmware/tools/plugin.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (c) 2008-2020 VMware, Inc. All rights reserved. + * Copyright (c) 2008-2020,2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -29,7 +29,19 @@ * @{ */ +/* + * glib.h should not be placed inside `extern "C"' blocks. + * However, this header is often placed inside such blocks. + * Here we change back into C++ for glib.h + */ +#ifdef __cplusplus +extern "C++" { +#endif #include +#ifdef __cplusplus +} +#endif + #if defined(G_PLATFORM_WIN32) # include # include diff --git a/open-vm-tools/lib/include/vmware/tools/threadPool.h b/open-vm-tools/lib/include/vmware/tools/threadPool.h index 5880fbcff..792be29a5 100644 --- a/open-vm-tools/lib/include/vmware/tools/threadPool.h +++ b/open-vm-tools/lib/include/vmware/tools/threadPool.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2010-2019 VMware, Inc. All rights reserved. + * Copyright (C) 2010-2019,2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -45,7 +45,19 @@ * thread. */ +/* + * glib-object.h should not be placed inside `extern "C"' blocks. + * However, this header is often placed inside such blocks. + * Here we change back into C++ for glib-object.h + */ +#ifdef __cplusplus +extern "C++" { +#endif #include +#ifdef __cplusplus +} +#endif + #include "vmware/tools/plugin.h" #define TOOLS_CORE_PROP_TPOOL "tcs_prop_thread_pool" diff --git a/open-vm-tools/services/plugins/dndcp/dndGuest/guestCopyPasteDest.cc b/open-vm-tools/services/plugins/dndcp/dndGuest/guestCopyPasteDest.cc index 918fdb37a..f91855624 100644 --- a/open-vm-tools/services/plugins/dndcp/dndGuest/guestCopyPasteDest.cc +++ b/open-vm-tools/services/plugins/dndcp/dndGuest/guestCopyPasteDest.cc @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2010-2016 VMware, Inc. All rights reserved. + * Copyright (C) 2010-2016,2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -23,10 +23,9 @@ */ #include "guestCopyPaste.hh" +#include extern "C" { - #include - #include "dndClipboard.h" #include "debug.h" } diff --git a/open-vm-tools/services/plugins/dndcp/dndGuest/guestCopyPasteSrc.cc b/open-vm-tools/services/plugins/dndcp/dndGuest/guestCopyPasteSrc.cc index f08917e28..42b14a74c 100644 --- a/open-vm-tools/services/plugins/dndcp/dndGuest/guestCopyPasteSrc.cc +++ b/open-vm-tools/services/plugins/dndcp/dndGuest/guestCopyPasteSrc.cc @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2010-2017 VMware, Inc. All rights reserved. + * Copyright (C) 2010-2017,2023 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -23,10 +23,9 @@ */ #include "guestCopyPaste.hh" +#include extern "C" { - #include - #include "dndClipboard.h" #include "debug.h" #include "cpNameUtil.h"