From: Kruti Date: Tue, 27 Aug 2024 09:11:00 +0000 (-0700) Subject: Change to common header file not applicable to open-vm-tools. X-Git-Tag: stable-12.5.0~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=86b308ab9eb8e4c3e154b30861cb66802c9e4624;p=thirdparty%2Fopen-vm-tools.git Change to common header file not applicable to open-vm-tools. --- diff --git a/open-vm-tools/lib/include/vm_basic_types.h b/open-vm-tools/lib/include/vm_basic_types.h index 0a36e3246..e0c38ed95 100644 --- a/open-vm-tools/lib/include/vm_basic_types.h +++ b/open-vm-tools/lib/include/vm_basic_types.h @@ -1,5 +1,6 @@ /********************************************************* - * Copyright (c) 1998-2023 VMware, Inc. All rights reserved. + * Copyright (c) 1998-2024 Broadcom. All Rights Reserved. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. * * 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 @@ -961,6 +962,27 @@ typedef void * UserVA; #define ALIGNED(n) #endif +#ifndef __has_attribute +# define __has_attribute(x) 0 +#endif + +/* + * COUNTED_BY attribute may be attached to the C99 flexible array + * member of a structure. It indicates that the number of the elements + * of the array is given by the field "member" in the same structure as + * the flexible array member. Compilers may use this information to + * improve detection of object size information for such structures + * and provide better results in compile-time diagnostics and runtime + * features like the array bound sanitizer. + * + * https://people.kernel.org/kees/bounded-flexible-arrays-in-c + */ + +#if __has_attribute(__counted_by__) +# define COUNTED_BY(member) __attribute__((__counted_by__(member))) +#else +# define COUNTED_BY(member) +#endif /* * Once upon a time, this was used to silence compiler warnings that