Commit 10e73046ae157c97cd94a00eddcf48b97d564df1

Add cstdint header, as required in Draft.

Note, that draft say about <stdint.h>:

  The header behaves as if it includes the header <cstdint>,
  and provides suffcient using declarations to declare in
  the global namespace all type names defined in the header <cstdint>.

Possible, I should ignore __STDC_LIMIT_MACROS macros, because:

  The header defines all functions, types, and macros the same
  as C99 7.18. [Note: The macros defined by <cstdint> are provided
  unconditionally. In particular, the symbols __STDC_LIMIT_MACROS
  and __STDC_CONSTANT_MACROS (mentioned in C99 footnotes 219, 220,
  and 222) play no role in C++. -- end note]
  
1/*
2 * Copyright (c) 2009
3 * Petr Ovtchenkov
4 *
5 * Licensed under the Academic Free License version 3.0
6 *
7 */
8
9#ifndef _STLP_CSTDINT
10#define _STLP_CSTDINT
11
12#ifndef _STLP_OUTERMOST_HEADER_ID
13# define _STLP_OUTERMOST_HEADER_ID 0x119
14# include <stl/_cprolog.h>
15#elif (_STLP_OUTERMOST_HEADER_ID == 0x119) && !defined(_STLP_DONT_POP_HEADER_ID)
16# define _STLP_DONT_POP_HEADER_ID
17#endif
18
19#ifdef _STLP_USE_NEW_C_HEADERS
20# ifdef _STLP_HAS_INCLUDE_NEXT
21# include_next <cstdint>
22# else
23# include _STLP_NATIVE_CPP_C_HEADER(cstdint)
24# endif
25#else // _STLP_USE_NEW_C_HEADERS
26# include <stdint.h>
27
28# if (_STLP_OUTERMOST_HEADER_ID == 0x119) && !defined(_STLP_INTERNAL_CSTDINT)
29# include "stl/_cstdint.h"
30# endif
31#endif // _STLP_USE_NEW_C_HEADERS
32
33#if (_STLP_OUTERMOST_HEADER_ID == 0x119)
34# ifndef _STLP_DONT_POP_HEADER_ID
35# include <stl/_epilog.h>
36# undef _STLP_OUTERMOST_HEADER_ID
37# else
38# undef _STLP_DONT_POP_HEADER_ID
39# endif
40#endif
41
42#endif // _STLP_CSTDINT
43
44// Local Variables:
45// mode:C++
46// End:
  
66 *
77 */
88
9#ifndef _STLP_STDINT_H
10#define _STLP_STDINT_H
11
912#ifndef _STLP_OUTERMOST_HEADER_ID
1013# define _STLP_OUTERMOST_HEADER_ID 0x263
1114# include <stl/_cprolog.h>
1616# define _STLP_DONT_POP_HEADER_ID
1717#endif
1818
19/* For 8.22.1/1 (see C99, Notes 219, 220, 222) */
20#ifndef __STDC_LIMIT_MACROS
21# define __STDC_LIMIT_MACROS
22#endif
23
24#ifndef __STDC_CONSTANT_MACROS
25# define __STDC_CONSTANT_MACROS
26#endif
27
1928#ifdef _MSC_VER
2029# include "stl/msc_stdint.h"
2130#else /* _MSC_VER */
3535# endif
3636#endif /* _MSC_VER */
3737
38#if defined(__cplusplus) && (_STLP_OUTERMOST_HEADER_ID == 0x263) && !defined(_STLP_INTERNAL_CSTDINT)
39# include "stl/_cstdint.h"
40#endif /* __cplusplus */
41
3842#if (_STLP_OUTERMOST_HEADER_ID == 0x263)
3943# ifndef _STLP_DONT_POP_HEADER_ID
4044# include <stl/_epilog.h>
4747# undef _STLP_DONT_POP_HEADER_ID
4848# endif
4949#endif
50
51#endif /* _STLP_STDINT_H */
  
1/*
2 * Copyright (c) 2009
3 * Petr Ovtchenkov
4 *
5 * Licensed under the Academic Free License version 3.0
6 *
7 */
8
9#ifndef _STLP_INTERNAL_CSTDINT
10#define _STLP_INTERNAL_CSTDINT
11
12_STLP_BEGIN_NAMESPACE
13
14using ::int8_t;
15using ::int16_t;
16using ::int32_t;
17using ::int64_t;
18
19using ::int_fast8_t;
20using ::int_fast16_t;
21using ::int_fast32_t;
22using ::int_fast64_t;
23
24using ::int_least8_t;
25using ::int_least16_t;
26using ::int_least32_t;
27using ::int_least64_t;
28
29using ::intmax_t;
30using ::intptr_t;
31
32using ::uint8_t;
33using ::uint16_t;
34using ::uint32_t;
35using ::uint64_t;
36
37using ::uint_fast8_t;
38using ::uint_fast16_t;
39using ::uint_fast32_t;
40using ::uint_fast64_t;
41
42using ::uint_least8_t;
43using ::uint_least16_t;
44using ::uint_least32_t;
45using ::uint_least64_t;
46
47using ::uintmax_t;
48using ::uintptr_t;
49
50_STLP_END_NAMESPACE
51
52#endif // _STLP_INTERNAL_CSTDINT
53
54// Local Variables:
55// mode:C++
56// End:
  
2525 cstdarg_header_test.cpp \
2626 cstddef_header_test.cpp \
2727 cstdio_header_test.cpp \
28 cstdint_header_test.cpp \
2829 cstdlib_header_test.cpp \
2930 cstring_header_test.cpp \
3031 ctime_header_test.cpp \
5555 sstream_header_test.cpp \
5656 stack_header_test.cpp \
5757 stdexcept_header_test.cpp \
58 stdint_header_test.cpp \
5859 stldbg_include.cpp \
5960 streambuf_header_test.cpp \
6061 string_header_test.cpp \
7878 stdarg_header_test.c \
7979 stddef_header_test.c \
8080 stdio_header_test.c \
81 stdint_c_header_test.c \
8182 stdlib_header_test.c \
8283 string_header_test.c \
8384 time_header_test.c \
  
1/* This test purpose is simply to check Standard header independancy that
2 * is to say that the header can be included alone without any previous
3 * include.
4 * Additionnaly, for C Standard headers that STLport expose, it can also be
5 * used to check that files included by those headers are compatible with
6 * pure C compilers.
7 */
8#include <cstdint>
9
10static int f()
11{
12 std::int32_t v = 1;
13
14 return static_cast<int>(v);
15}
  
1/* This test purpose is simply to check Standard header independancy that
2 * is to say that the header can be included alone without any previous
3 * include.
4 * Additionnaly, for C Standard headers that STLport expose, it can also be
5 * used to check that files included by those headers are compatible with
6 * pure C compilers.
7 */
8#include <stdint.h>
9
10static int f()
11{
12 int32_t v = 1;
13
14 return (int)v;
15}
  
1/* This test purpose is simply to check Standard header independancy that
2 * is to say that the header can be included alone without any previous
3 * include.
4 * Additionnaly, for C Standard headers that STLport expose, it can also be
5 * used to check that files included by those headers are compatible with
6 * pure C compilers.
7 */
8#include <stdint.h>
9
10static int f()
11{
12 std::int32_t v = 1;
13
14 return static_cast<int>(v);
15}