Skip to content

Commit 99fa73b

Browse files
committed
Update cinttypes/inttypes.h
- Replace int aliases with include of stdint.h - Add str/wcs function stubs - Add header guards
1 parent ce58aff commit 99fa73b

File tree

2 files changed

+22
-10
lines changed

2 files changed

+22
-10
lines changed
Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,12 @@
1-
#include <inttypes.h>
1+
#ifndef _GHLIBCPP_CINTTYPES
2+
#define _GHLIBCPP_CINTTYPES
3+
#include "inttypes.h"
4+
5+
namespace std {
6+
using ::strtoimax;
7+
using ::strtoumax;
8+
using ::wcstoimax;
9+
using ::wcstoumax;
10+
} // namespace std
11+
12+
#endif // _GHLIBCPP_CINTTYPES
Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
#pragma once
1+
#ifndef _GHLIBCPP_INTTYPES
2+
#define _GHLIBCPP_INTTYPES
3+
#include <stdint.h>
24

3-
typedef signed char int8_t;
4-
typedef signed short int int16_t;
5-
typedef signed long int int32_t;
6-
typedef signed long long int int64_t;
5+
// String conversion functions
6+
intmax_t strtoimax(const char *str, char **endptr, int base);
7+
uintmax_t strtoumax(const char *str, char **endptr, int base);
78

8-
typedef unsigned char uint8_t;
9-
typedef unsigned short int uint16_t;
10-
typedef unsigned long int uint32_t;
11-
typedef unsigned long long int uint64_t;
9+
// Wide character versions
10+
intmax_t wcstoimax(const wchar_t *str, wchar_t **endptr, int base);
11+
uintmax_t wcstoumax(const wchar_t *str, wchar_t **endptr, int base);
12+
#endif // _GHLIBCPP_INTTYPES

0 commit comments

Comments
 (0)