xref: /PHP-8.1/main/php_stdint.h (revision 01b3fc03)
1 /*
2    +----------------------------------------------------------------------+
3    | Copyright (c) The PHP Group                                          |
4    +----------------------------------------------------------------------+
5    | This source file is subject to version 3.01 of the PHP license,      |
6    | that is bundled with this package in the file LICENSE, and is        |
7    | available through the world-wide-web at the following url:           |
8    | https://www.php.net/license/3_01.txt                                 |
9    | If you did not receive a copy of the PHP license and are unable to   |
10    | obtain it through the world-wide-web, please send a note to          |
11    | license@php.net so we can mail you a copy immediately.               |
12    +----------------------------------------------------------------------+
13    | Author: Michael Wallner <mike@php.net>                               |
14    +----------------------------------------------------------------------+
15 */
16 
17 #ifndef PHP_STDINT_H
18 #define PHP_STDINT_H
19 
20 /* C99 requires these for C++ to get the definitions
21  * of INT64_MAX and other macros used by Zend/zend_long.h
22  * C11 drops this requirement, so these effectively
23  * just backport that piece of behavior.
24  *
25  * These defines are placed here instead of
26  * with the include below, because sys/types
27  * and inttypes may include stdint themselves.
28  * And these definitions MUST come first.
29  */
30 #ifdef __cplusplus
31 # ifndef __STDC_LIMIT_MACROS
32 #  define __STDC_LIMIT_MACROS
33 # endif
34 # ifndef __STDC_CONSTANT_MACROS
35 #  define __STDC_CONSTANT_MACROS
36 # endif
37 # ifndef __STDC_FORMAT_MACROS
38 #  define __STDC_FORMAT_MACROS
39 # endif
40 #endif
41 
42 #include <inttypes.h>
43 #include <stdint.h>
44 
45 #if defined(_MSC_VER)
46 # ifndef u_char
47 typedef unsigned __int8   u_char;
48 # endif
49 #endif /* !_MSC_VER */
50 
51 #endif /* PHP_STDINT_H */
52