1 /** @file mlan_remap_mem_operations.h
2  *
3  *  @brief This file contains redefinition of memory routines
4  *
5  *  Copyright 2008-2024 NXP
6  *
7  *  SPDX-License-Identifier: BSD-3-Clause
8  *
9  */
10 
11 /*
12  * File added for wmsdk. Not present in original mlan release.
13  *
14  * Purpose: The mlan release source files contain non-standard (libc)
15  * prototypes for memcpy, memmove, memcmp, etc. This causes problems when
16  * mlan header files are included by the remaining code. We work around
17  * this problem by remapping these operations to standard functions.
18  *
19  * IMPORTANT: Ensure that this file is included in every mlan source file
20  * which used mem* operations. ENSURE that this is the last file included
21  * in the include header list.
22  */
23 
24 #ifdef __memset
25 #undef __memset
26 #endif
27 /** Memset routine */
28 #define __memset(adapter, s, c, len) memset((void *)(s), (int)(c), (size_t)(len))
29 
30 #ifdef __memmove
31 #undef __memmove
32 #endif
33 /** Memmove routine */
34 #define __memmove(adapter, dest, src, len) memmove((void *)(dest), (const void *)(src), (size_t)(len))
35 
36 #ifdef __memcpy
37 #undef __memcpy
38 #endif
39 /** Memcpy routine */
40 #define __memcpy(adapter, to, from, len) memcpy((void *)(to), (const void *)(from), (size_t)(len))
41 
42 #ifdef __memcmp
43 #undef __memcmp
44 #endif
45 /** Memcmp routine */
46 #define __memcmp(adapter, s1, s2, len) memcmp((const void *)(s1), (const void *)(s2), (size_t)(len))
47