From: Katy Feng Date: Thu, 5 Oct 2023 17:35:28 +0000 (-0700) Subject: Change to common header file not applicable to open-vm-tools. X-Git-Tag: stable-12.4.0~79 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f8b150212afbf963241685406c42002b80b10a11;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/dynarray.h b/open-vm-tools/lib/include/dynarray.h index 3b848290b..f55d77091 100644 --- a/open-vm-tools/lib/include/dynarray.h +++ b/open-vm-tools/lib/include/dynarray.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2004-2019 VMware, Inc. All rights reserved. + * Copyright (C) 2004-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 @@ -254,8 +254,14 @@ DynArray_Copy(DynArray *src, // IN * * Yes, it's a poor man's template (but better than nothing). * + * Note that emscripten does not allow function pointer casting, and has a + * compiler warning to enforce this, so we cannot use DEFINE_DYNARRAY_TYPE + * as it relies on a function cast to define T##Array_QSort. + * */ +#ifndef __EMSCRIPTEN__ + #define DEFINE_DYNARRAY_TYPE(T) DEFINE_DYNARRAY_NAMED_TYPE(T, T) #define DEFINE_DYNARRAY_NAMED_TYPE(T, TYPE) \ @@ -354,9 +360,12 @@ DynArray_Copy(DynArray *src, // IN { \ return DynArray_Copy((DynArray *)src, (DynArray *)dest); \ } + /* Define DynArray of DynBuf. */ DEFINE_DYNARRAY_TYPE(DynBuf) +#endif // ifndef __EMSCRIPTEN__ + #if defined(__cplusplus) } // extern "C" #endif