Replace __forceinline with zend_always_inline in win32/ #17482
Merged
+23
−23
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
__forceinline
is MSVC specific (and also understood by Clang on Windows), but the code in win32/ should not be constrained to these compilers. Since we already havezend_always_inline
, we use this instead.The motivation is to make the win32/ more portable, since there are other relevant compilers than MSVC and Clang on Windows (e.g. MinGW GCC). While this commit doesn't really change anything in this regard, it makes it simpler to do so.
Note that I have deliberately not touched some bundled libraries using
__forceinline
, because it may make updating these a bit harder, and more importantly, because they already use__forceinline
only if_MSC_VER
is defined.Also note that I consider the use of
zend_always_inline
generally doubtful, because it (a) does not necessarily enforce inlining (what might easily be overlooked), and (b) the programmer doesn't know better than the compiler (maybe for some tiny amount of time, but the next commit/compiler version may make that moot; profile guided optimization is likely the better judge).We should probably have a look at our uses of
__inline
which appear to be outdated.