From 7db146eea70e4c96ab57ca005f7e499884c14ecb Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Mon, 31 May 2021 10:05:18 +0200 Subject: [PATCH] Remove "inline" defines on Windows (#7071) Newer MSVC versions support the `inline` keyword, so we do not need to explicitly define it. We also shouldn't define `inline` to `__forceinline`, as we already have `zend_always_inline` to indicate this requirement. --- Zend/zend_config.w32.h | 10 ---------- main/php.h | 7 ------- win32/build/confutils.js | 2 +- 3 files changed, 1 insertion(+), 18 deletions(-) diff --git a/Zend/zend_config.w32.h b/Zend/zend_config.w32.h index 47387895e5..da6b1f8958 100644 --- a/Zend/zend_config.w32.h +++ b/Zend/zend_config.w32.h @@ -48,16 +48,6 @@ #define strcasecmp(s1, s2) _stricmp(s1, s2) #define strncasecmp(s1, s2, n) _strnicmp(s1, s2, n) -#ifndef __cplusplus -/* This will cause the compilation process to be MUCH longer, but will generate - * a much quicker PHP binary - */ -#ifdef ZEND_WIN32_FORCE_INLINE -# undef inline -# define inline __forceinline -#endif -#endif - #ifdef LIBZEND_EXPORTS # define ZEND_API __declspec(dllexport) #else diff --git a/main/php.h b/main/php.h index adeefc5a63..e9f24a0237 100644 --- a/main/php.h +++ b/main/php.h @@ -95,13 +95,6 @@ typedef int gid_t; typedef char * caddr_t; typedef int pid_t; -# ifndef PHP_DEBUG -# ifdef inline -# undef inline -# endif -# define inline __inline -# endif - # define M_TWOPI (M_PI * 2.0) # define off_t _off_t diff --git a/win32/build/confutils.js b/win32/build/confutils.js index 5cb461ef47..01c76b0e1e 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -3439,7 +3439,7 @@ function toolset_setup_build_mode() ADD_FLAG("CFLAGS", "/Od /D NDebug /D NDEBUG /D ZEND_WIN32_NEVER_INLINE /D ZEND_DEBUG=0"); } else { // Equivalent to Release_TSInline build -> best optimization - ADD_FLAG("CFLAGS", "/Ox /D NDebug /D NDEBUG /D ZEND_WIN32_FORCE_INLINE /GF /D ZEND_DEBUG=0"); + ADD_FLAG("CFLAGS", "/Ox /D NDebug /D NDEBUG /GF /D ZEND_DEBUG=0"); } // if you have VS.Net /GS hardens the binary against buffer overruns