Libffi: Always define `WIN32_LEAN_AND_MEAN` before <windows.h>
`WIN32_LEAN_AND_MEAN` is now always defined before including `<windows.h>` in libffi to reduce header pollution.
The WIN32_LEAN_AND_MEAN macro is defined before including <windows.h> in libffi’s source code. Defining this macro reduces the amount of code included from the Windows headers, which speeds up compilation and avoids potential conflicts. The change has been forwarded upstream to the libffi project.
In Details
This commit ensures that WIN32_LEAN_AND_MEAN is defined before including <windows.h> in src/aarch64/ffi.c within the libffi subdirectory. This macro reduces the size of the Windows headers included, preventing namespace pollution and speeding up compilation. The upstream pull request is at https://github.com/libffi/libffi/pull/937. A Windows or cross-platform developer might encounter issues if this macro is not defined.
For Context
When compiling code that uses the Windows operating system's libraries, it's often useful to define a macro called WIN32_LEAN_AND_MEAN. This macro tells the compiler to include only the most essential parts of the Windows libraries, which can speed up compilation and prevent conflicts with other libraries. This commit ensures that WIN32_LEAN_AND_MEAN is always defined when compiling libffi on Windows.