mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-05-18 14:16:55 +08:00
Fix bug #49827: wrong cast to size_t on 16-bit x86 architecture
I hope I caught all of them. TODO: Same for casts to get rid of alignment warnings, these are also casts via size_t
This commit is contained in:
@@ -133,6 +133,11 @@ typedef uintptr_t mem_ptr_t;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/** C++ const_cast<target_type>(val) equivalent to remove constness from a value */
|
||||
#ifndef LWIP_CONST_CAST
|
||||
#define LWIP_CONST_CAST(target_type, val) ((target_type)((ptrdiff_t)val))
|
||||
#endif
|
||||
|
||||
/** Allocates a memory buffer of specified size that is of sufficient size to align
|
||||
* its start address using LWIP_MEM_ALIGN.
|
||||
* You can declare your own version here e.g. to enforce alignment without adding
|
||||
|
||||
Reference in New Issue
Block a user