php_stdint.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. #ifndef PHP_STDINT_H
  17. #define PHP_STDINT_H
  18. /* C99 requires these for C++ to get the definitions
  19. * of INT64_MAX and other macros used by Zend/zend_long.h
  20. * C11 drops this requirement, so these effectively
  21. * just backport that piece of behavior.
  22. *
  23. * These defines are placed here instead of
  24. * with the include below, because sys/types
  25. * and inttypes may include stdint themselves.
  26. * And these definitions MUST come first.
  27. */
  28. #ifdef __cplusplus
  29. # ifndef __STDC_LIMIT_MACROS
  30. # define __STDC_LIMIT_MACROS
  31. # endif
  32. # ifndef __STDC_CONSTANT_MACROS
  33. # define __STDC_CONSTANT_MACROS
  34. # endif
  35. # ifndef __STDC_FORMAT_MACROS
  36. # define __STDC_FORMAT_MACROS
  37. # endif
  38. #endif
  39. #include <inttypes.h>
  40. #include <stdint.h>
  41. #if defined(_MSC_VER)
  42. # ifndef u_char
  43. typedef unsigned __int8 u_char;
  44. # endif
  45. #endif /* !_MSC_VER */
  46. #endif /* PHP_STDINT_H */