config_win32.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /* Copyright (C) 2001-2023 Artifex Software, Inc.
  2. All Rights Reserved.
  3. This software is provided AS-IS with no warranty, either express or
  4. implied.
  5. This software is distributed under license and may not be copied,
  6. modified or distributed except as expressly authorized under the terms
  7. of the license contained in the file LICENSE in this distribution.
  8. Refer to licensing information at http://www.artifex.com or contact
  9. Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
  10. CA 94129, USA, for further information.
  11. */
  12. /*
  13. jbig2dec
  14. */
  15. /* configuration header file for compiling under Microsoft Windows */
  16. #ifdef _MSC_VER
  17. /* VS 2012 and later have stdint.h */
  18. # if _MSC_VER >= 1700
  19. # include <stdint.h>
  20. # else
  21. typedef signed char int8_t;
  22. typedef short int int16_t;
  23. typedef int int32_t;
  24. typedef __int64 int64_t;
  25. typedef unsigned char uint8_t;
  26. typedef unsigned short int uint16_t;
  27. typedef unsigned int uint32_t;
  28. typedef unsigned __int64 uint64_t;
  29. #ifndef SIZE_MAX
  30. #define SIZE_MAX (~((size_t) 0))
  31. #endif
  32. # endif
  33. /* VS 2008 and later have vsnprintf */
  34. # if _MSC_VER < 1500
  35. # define vsnprintf _vsnprintf
  36. /* Previously we defined inline as nothing for 2005 and below */
  37. # define inline
  38. #else
  39. /* VS 2008 has __inline but not inline, later versions (unknown exactly where) define inline
  40. * so cater for it being defined already.
  41. */
  42. # if !(defined(inline))
  43. # define inline __inline
  44. # endif
  45. # endif
  46. /* VS 2014 and later have (finally) snprintf */
  47. # if _MSC_VER >= 1900
  48. # define STDC99
  49. # else
  50. # define snprintf _snprintf
  51. # endif
  52. #else /* _MSC_VER */
  53. /* Not VS -- it had best behave */
  54. # include <stdint.h>
  55. #endif /* _MSC_VER */