spandsp 3.0.0
inttypes.h
1/*
2 * SpanDSP - a series of DSP components for telephony
3 *
4 * inttypes.h - a fudge for MSVC, which lacks this header
5 *
6 * Written by Steve Underwood <steveu@coppice.org>
7 *
8 * Copyright (C) 2006 Michael Jerris
9 *
10 *
11 * This file is released in the public domain.
12 *
13 */
14
15#if !defined(_INTTYPES_H_)
16#define _INTTYPES_H_
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22#if defined(_MSC_VER) && _MSC_VER >= 1900
23#include <stdint.h>
24#else
25
26typedef __int8 __int8_t;
27typedef __int16 __int16_t;
28typedef __int32 __int32_t;
29typedef __int64 __int64_t;
30
31typedef unsigned __int8 uint8_t;
32typedef unsigned __int16 uint16_t;
33typedef unsigned __int32 uint32_t;
34typedef unsigned __int64 uint64_t;
35typedef __int8 int8_t;
36typedef __int16 int16_t;
37typedef __int32 int32_t;
38typedef __int64 int64_t;
39
40#endif
41#if !defined(INFINITY) && _MSC_VER < 1800
42#define INFINITY 0x7FFFFFFF
43#endif
44
45#if !defined(UINT8_MAX)
46#define UINT8_MAX 0xFF
47#endif
48#if !defined(UINT16_MAX)
49#define UINT16_MAX 0xFFFF
50#endif
51#if !defined(UINT32_MAX)
52#define UINT32_MAX 0xFFFFFFFF
53#endif
54
55#if !defined(INT16_MAX)
56#define INT16_MAX 0x7FFF
57#endif
58#if !defined(INT16_MIN)
59#define INT16_MIN (-INT16_MAX - 1)
60#endif
61
62#if !defined(INT32_MAX)
63#define INT32_MAX (2147483647)
64#endif
65#if !defined(INT32_MIN)
66#define INT32_MIN (-2147483647 - 1)
67#endif
68
69#define PRId8 "d"
70#define PRId16 "d"
71#define PRId32 "ld"
72#define PRId64 "lld"
73
74#define PRIu8 "u"
75#define PRIu16 "u"
76#define PRIu32 "lu"
77#define PRIu64 "llu"
78
79#ifdef __cplusplus
80}
81#endif
82
83#endif