From: Oliver Kurth Date: Tue, 24 Apr 2018 00:08:15 +0000 (-0700) Subject: Header file change in preparation for C++11 compilation. Also updating X-Git-Tag: stable-10.3.0~55 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5d9cc73f1c7979466d55f7897f98c0888d2fb15d;p=thirdparty%2Fopen-vm-tools.git Header file change in preparation for C++11 compilation. Also updating copyright dates. --- diff --git a/open-vm-tools/lib/include/vm_product_versions.h b/open-vm-tools/lib/include/vm_product_versions.h index 27820ff0a..f34efda9a 100644 --- a/open-vm-tools/lib/include/vm_product_versions.h +++ b/open-vm-tools/lib/include/vm_product_versions.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2017 VMware, Inc. All rights reserved. + * Copyright (C) 1998-2018 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 diff --git a/open-vm-tools/lib/include/xdrutil.h b/open-vm-tools/lib/include/xdrutil.h index a39e27d6a..bb32ac1c9 100644 --- a/open-vm-tools/lib/include/xdrutil.h +++ b/open-vm-tools/lib/include/xdrutil.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2008-2017 VMware, Inc. All rights reserved. + * Copyright (C) 2008-2018 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 @@ -65,17 +65,26 @@ extern "C" { * from a given XDR array. */ #ifdef __GNUC__ -# define XDRUTIL_ARRAYAPPEND(ptr, field, cnt) \ - (typeof ((ptr)->field.field##_val)) \ - XdrUtil_ArrayAppend((void **) &(ptr)->field.field##_val, \ - &(ptr)->field.field##_len, \ - sizeof *(ptr)->field.field##_val, \ - (cnt)) +# if defined(__cpp_decltype) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# define XDRUTIL_ARRAYAPPEND(ptr, field, cnt) \ + (decltype ((ptr)->field.field##_val)) \ + XdrUtil_ArrayAppend((void **) &(ptr)->field.field##_val, \ + &(ptr)->field.field##_len, \ + sizeof *(ptr)->field.field##_val, \ + (cnt)) +# else +# define XDRUTIL_ARRAYAPPEND(ptr, field, cnt) \ + (typeof ((ptr)->field.field##_val)) \ + XdrUtil_ArrayAppend((void **) &(ptr)->field.field##_val, \ + &(ptr)->field.field##_len, \ + sizeof *(ptr)->field.field##_val, \ + (cnt)) +# endif #else -# define XDRUTIL_ARRAYAPPEND(ptr, field, cnt) \ - XdrUtil_ArrayAppend((void **) &(ptr)->field.field##_val, \ - &(ptr)->field.field##_len, \ - sizeof *(ptr)->field.field##_val, \ +# define XDRUTIL_ARRAYAPPEND(ptr, field, cnt) \ + XdrUtil_ArrayAppend((void **) &(ptr)->field.field##_val, \ + &(ptr)->field.field##_len, \ + sizeof *(ptr)->field.field##_val, \ (cnt)) #endif