Skip to content

Commit 300811f

Browse files
authored
Remove support for unsupported MSVC versions (GH-17128)
As of PHP 8.4.0, MSVC >= 1920 (aka. Visual Studio 2019 RTW 16.0) is required anyway[1], so we can clean up a bit. [1] <b3d6414>
1 parent 07cd468 commit 300811f

File tree

6 files changed

+3
-29
lines changed

6 files changed

+3
-29
lines changed

Zend/zend_config.w32.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@
3838

3939
#include <float.h>
4040

41-
#if _MSC_VER < 1900
42-
#define snprintf _snprintf
43-
#endif
4441
#define strcasecmp(s1, s2) _stricmp(s1, s2)
4542
#define strncasecmp(s1, s2, n) _strnicmp(s1, s2, n)
4643

Zend/zend_portability.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,9 +307,7 @@ char *alloca();
307307

308308
#if defined(__GNUC__) && ZEND_GCC_VERSION >= 3004 && defined(__i386__)
309309
# define ZEND_FASTCALL __attribute__((fastcall))
310-
#elif defined(_MSC_VER) && defined(_M_IX86) && _MSC_VER == 1700
311-
# define ZEND_FASTCALL __fastcall
312-
#elif defined(_MSC_VER) && _MSC_VER >= 1800
310+
#elif defined(_MSC_VER)
313311
# define ZEND_FASTCALL __vectorcall
314312
#else
315313
# define ZEND_FASTCALL

ext/openssl/openssl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
/* Common */
7070
#include <time.h>
7171

72-
#if (defined(PHP_WIN32) && defined(_MSC_VER) && _MSC_VER >= 1900)
72+
#if (defined(PHP_WIN32) && defined(_MSC_VER))
7373
#define timezone _timezone /* timezone is called _timezone in LibC */
7474
#endif
7575

ext/soap/php_encoding.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2950,7 +2950,7 @@ static xmlNodePtr to_xml_datetime_ex(encodeTypePtr type, zval *data, char *forma
29502950
(ta->tm_gmtoff < 0) ? '-' : '+',
29512951
labs(ta->tm_gmtoff / 3600), labs( (ta->tm_gmtoff % 3600) / 60 ));
29522952
#else
2953-
# if defined(__CYGWIN__) || (defined(PHP_WIN32) && defined(_MSC_VER) && _MSC_VER >= 1900)
2953+
# if defined(__CYGWIN__) || (defined(PHP_WIN32) && defined(_MSC_VER))
29542954
snprintf(tzbuf, sizeof(tzbuf), "%c%02d:%02d", ((ta->tm_isdst ? _timezone - 3600:_timezone)>0)?'-':'+', abs((ta->tm_isdst ? _timezone - 3600 : _timezone) / 3600), abs(((ta->tm_isdst ? _timezone - 3600 : _timezone) % 3600) / 60));
29552955
# else
29562956
snprintf(tzbuf, sizeof(tzbuf), "%c%02d:%02d", ((ta->tm_isdst ? timezone - 3600:timezone)>0)?'-':'+', abs((ta->tm_isdst ? timezone - 3600 : timezone) / 3600), abs(((ta->tm_isdst ? timezone - 3600 : timezone) % 3600) / 60));

ext/standard/string.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -123,21 +123,8 @@ PHPAPI struct lconv *localeconv_r(struct lconv *out)
123123
tsrm_mutex_lock( locale_mutex );
124124
#endif
125125

126-
/* cur->locinfo is struct __crt_locale_info which implementation is
127-
hidden in vc14. TODO revisit this and check if a workaround available
128-
and needed. */
129-
#if defined(PHP_WIN32) && _MSC_VER < 1900 && defined(ZTS)
130-
{
131-
/* Even with the enabled per thread locale, localeconv
132-
won't check any locale change in the master thread. */
133-
_locale_t cur = _get_current_locale();
134-
*out = *cur->locinfo->lconv;
135-
_free_locale(cur);
136-
}
137-
#else
138126
/* localeconv doesn't return an error condition */
139127
*out = *localeconv();
140-
#endif
141128

142129
#ifdef ZTS
143130
tsrm_mutex_unlock( locale_mutex );

win32/time.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,6 @@ struct itimerval {
2828
struct timeval it_value; /* current value */
2929
};
3030

31-
#if !defined(timespec) && _MSC_VER < 1900
32-
struct timespec
33-
{
34-
time_t tv_sec; /* seconds */
35-
long tv_nsec; /* nanoseconds */
36-
};
37-
#endif
38-
3931
#define ITIMER_REAL 0 /*generates sigalrm */
4032
#define ITIMER_VIRTUAL 1 /*generates sigvtalrm */
4133
#define ITIMER_VIRT 1 /*generates sigvtalrm */

0 commit comments

Comments
 (0)