> From: Andre Muezerie [mailto:andre...@linux.microsoft.com] > Sent: Tuesday, 18 February 2025 17.32 > > There's no MSVC equivalent for compiler extension __builtin_constant_p. > EAL already had __rte_constant which was used as a first attempt to > workaround __builtin_constant_p when using MSVC. However, there are > pieces of code that would benefit from being able to provide a default > value to be used instead of it being always 0 like how it was done by > __rte_constant. > > A new macro is added here allowing such default to be provided by the > caller.
NAK to the new macro. Please use the sizeof() hack suggested by Stephen to provide an implementation of __rte_constant(e) for MSVC. Here's a link to an example of the hack: https://news.ycombinator.com/item?id=16720172