mirror of
https://github.com/php/php-src.git
synced 2025-08-15 13:38:49 +02:00

For Clang, we just need to define the respective macros, since these built-ins are available in all supported Clang versions (>= 4.0.0, currently)[1]. For MSVC (and possibly other compilers) we use the respective APIs of intsafe.h[2] which are available as of Windows 7/Server 2008 R2. This avoids the UB due to signed integer overflow that may happen with our fallback implementations. We also drop the superfluous SHORT_MAX definition from pdo_firebird. This shouldn't be defined unconditionally, but since it is apparently unused, we remove it altogether. [1] <https://releases.llvm.org/4.0.0/tools/clang/docs/LanguageExtensions.html> [2] <https://learn.microsoft.com/en-us/windows/win32/api/intsafe/>
54 lines
1.9 KiB
C
54 lines
1.9 KiB
C
/*
|
|
+----------------------------------------------------------------------+
|
|
| Zend Engine |
|
|
+----------------------------------------------------------------------+
|
|
| Copyright (c) Zend Technologies Ltd. (http://www.zend.com) |
|
|
+----------------------------------------------------------------------+
|
|
| This source file is subject to version 2.00 of the Zend license, |
|
|
| that is bundled with this package in the file LICENSE, and is |
|
|
| available through the world-wide-web at the following url: |
|
|
| http://www.zend.com/license/2_00.txt. |
|
|
| If you did not receive a copy of the Zend license and are unable to |
|
|
| obtain it through the world-wide-web, please send a note to |
|
|
| license@zend.com so we can mail you a copy immediately. |
|
|
+----------------------------------------------------------------------+
|
|
| Authors: Andi Gutmans <andi@php.net> |
|
|
| Zeev Suraski <zeev@php.net> |
|
|
+----------------------------------------------------------------------+
|
|
*/
|
|
|
|
#ifndef ZEND_CONFIG_W32_H
|
|
#define ZEND_CONFIG_W32_H
|
|
|
|
#include <../main/config.w32.h>
|
|
|
|
#define _CRTDBG_MAP_ALLOC
|
|
|
|
#include <malloc.h>
|
|
#include <stdlib.h>
|
|
#include <crtdbg.h>
|
|
|
|
#include <string.h>
|
|
|
|
#ifndef ZEND_INCLUDE_FULL_WINDOWS_HEADERS
|
|
#define WIN32_LEAN_AND_MEAN
|
|
#endif
|
|
#include <winsock2.h>
|
|
#include <windows.h>
|
|
|
|
#include <intsafe.h>
|
|
#include <float.h>
|
|
|
|
#define strcasecmp(s1, s2) _stricmp(s1, s2)
|
|
#define strncasecmp(s1, s2, n) _strnicmp(s1, s2, n)
|
|
|
|
#ifdef LIBZEND_EXPORTS
|
|
# define ZEND_API __declspec(dllexport)
|
|
#else
|
|
# define ZEND_API __declspec(dllimport)
|
|
#endif
|
|
|
|
#define ZEND_DLEXPORT __declspec(dllexport)
|
|
#define ZEND_DLIMPORT __declspec(dllimport)
|
|
|
|
#endif /* ZEND_CONFIG_W32_H */
|