Skip to content

Commit

Permalink
types.h: fix windows build error
Browse files Browse the repository at this point in the history
Windows Kits\10\Include\10.0.22621.0\ucrt\corecrt.h(605,39): error C2371: 'wint_t': redefinition; different basic types
Windows Kits\10\Include\10.0.22621.0\ucrt\corecrt.h(606,39): error C2371: 'wctype_t': redefinition; different basic types

Co-authored-by: chenxiaoyi <[email protected]>
Co-authored-by: xuxin19 <[email protected]>
  • Loading branch information
chenxiaoyi and xuxin930 committed Aug 13, 2024
1 parent 2067a81 commit 5d9aa53
Show file tree
Hide file tree
Showing 25 changed files with 83 additions and 2 deletions.
3 changes: 3 additions & 0 deletions arch/arm/include/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ typedef __WCHAR_TYPE__ _wchar_t;
typedef int _wchar_t;
#endif

typedef int _wint_t;
typedef int _wctype_t;

/* A size is 4 bytes */

#if defined(__SIZE_TYPE__)
Expand Down
3 changes: 3 additions & 0 deletions arch/arm64/include/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ typedef __WCHAR_TYPE__ _wchar_t;
typedef int _wchar_t;
#endif

typedef int _wint_t;
typedef int _wctype_t;

#if defined(__SIZE_TYPE__)
/* If __SIZE_TYPE__ is defined we define ssize_t based on size_t.
* We simply change "unsigned" to "signed" for this single definition
Expand Down
3 changes: 3 additions & 0 deletions arch/avr/include/avr/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ typedef __WCHAR_TYPE__ _wchar_t;
typedef int _wchar_t;
#endif

typedef int _wint_t;
typedef int _wctype_t;

/* A (near) size is 2 bytes */

#if defined(__SIZE_TYPE__)
Expand Down
3 changes: 3 additions & 0 deletions arch/avr/include/avr32/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ typedef __WCHAR_TYPE__ _wchar_t;
typedef int _wchar_t;
#endif

typedef int _wint_t;
typedef int _wctype_t;

/* A size is 4 bytes */

#if defined(__SIZE_TYPE__)
Expand Down
3 changes: 3 additions & 0 deletions arch/hc/include/hc12/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ typedef __WCHAR_TYPE__ _wchar_t;
typedef int _wchar_t;
#endif

typedef int _wint_t;
typedef int _wctype_t;

/* A size is two bytes */

#if defined(__SIZE_TYPE__)
Expand Down
3 changes: 3 additions & 0 deletions arch/hc/include/hcs12/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ typedef __WCHAR_TYPE__ _wchar_t;
typedef int _wchar_t;
#endif

typedef int _wint_t;
typedef int _wctype_t;

/* A size is two bytes */

#if defined(__SIZE_TYPE__)
Expand Down
3 changes: 3 additions & 0 deletions arch/mips/include/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ typedef __WCHAR_TYPE__ _wchar_t;
typedef int _wchar_t;
#endif

typedef int _wint_t;
typedef int _wctype_t;

/* A size is 4 bytes */

#if defined(__SIZE_TYPE__)
Expand Down
3 changes: 3 additions & 0 deletions arch/misoc/include/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ typedef __WCHAR_TYPE__ _wchar_t;
typedef int _wchar_t;
#endif

typedef int _wint_t;
typedef int _wctype_t;

/* A size is 4 bytes */

#if defined(__SIZE_TYPE__)
Expand Down
3 changes: 3 additions & 0 deletions arch/or1k/include/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ typedef __WCHAR_TYPE__ _wchar_t;
typedef int _wchar_t;
#endif

typedef int _wint_t;
typedef int _wctype_t;

/* A size is 4 bytes */

#if defined(__SIZE_TYPE__)
Expand Down
3 changes: 3 additions & 0 deletions arch/renesas/include/m16c/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ typedef __WCHAR_TYPE__ _wchar_t;
typedef int _wchar_t;
#endif

typedef int _wint_t;
typedef int _wctype_t;

/* A size is 2 bytes */

#if defined(__SIZE_TYPE__)
Expand Down
3 changes: 3 additions & 0 deletions arch/renesas/include/rx65n/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ typedef __WCHAR_TYPE__ _wchar_t;
typedef int _wchar_t;
#endif

typedef int _wint_t;
typedef int _wctype_t;

/* A size is 4 bytes */

#if defined(__SIZE_TYPE__)
Expand Down
3 changes: 3 additions & 0 deletions arch/renesas/include/sh1/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ typedef __WCHAR_TYPE__ _wchar_t;
typedef int _wchar_t;
#endif

typedef int _wint_t;
typedef int _wctype_t;

/* A size is 4 bytes */

#if defined(__SIZE_TYPE__)
Expand Down
3 changes: 3 additions & 0 deletions arch/risc-v/include/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ typedef __WCHAR_TYPE__ _wchar_t;
typedef int _wchar_t;
#endif

typedef int _wint_t;
typedef int _wctype_t;

/* Use uintreg_t for register-width integers */

#ifdef CONFIG_ARCH_RV32
Expand Down
12 changes: 12 additions & 0 deletions arch/sim/include/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,18 @@ typedef unsigned short _wchar_t;
typedef int _wchar_t;
#endif

#ifdef _MSC_VER
typedef unsigned short _wint_t;
#else
typedef int _wint_t;
#endif

#ifdef _MSC_VER
typedef unsigned short _wctype_t;
#else
typedef int _wctype_t;
#endif

#if defined(__SIZE_TYPE__)
/* If __SIZE_TYPE__ is defined we define ssize_t based on size_t.
* We simply change "unsigned" to "signed" for this single definition
Expand Down
3 changes: 3 additions & 0 deletions arch/sparc/include/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ typedef __WCHAR_TYPE__ _wchar_t;
typedef int _wchar_t;
#endif

typedef int _wint_t;
typedef int _wctype_t;

/* A size is 4 bytes */

#if defined(__SIZE_TYPE__)
Expand Down
3 changes: 3 additions & 0 deletions arch/tricore/include/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ typedef __WCHAR_TYPE__ _wchar_t;
typedef int _wchar_t;
#endif

typedef int _wint_t;
typedef int _wctype_t;

/* A size is 4 bytes */

#if defined(__SIZE_TYPE__)
Expand Down
3 changes: 3 additions & 0 deletions arch/x86/include/i486/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ typedef __WCHAR_TYPE__ _wchar_t;
typedef int _wchar_t;
#endif

typedef int _wint_t;
typedef int _wctype_t;

/* A size is 4 bytes */

#if defined(__SIZE_TYPE__)
Expand Down
3 changes: 3 additions & 0 deletions arch/x86_64/include/intel64/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ typedef __WCHAR_TYPE__ _wchar_t;
typedef int _wchar_t;
#endif

typedef int _wint_t;
typedef int _wctype_t;

#if defined(__SIZE_TYPE__)
/* If __SIZE_TYPE__ is defined we define ssize_t based on size_t.
* We simply change "unsigned" to "signed" for this single definition
Expand Down
3 changes: 3 additions & 0 deletions arch/xtensa/include/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ typedef __WCHAR_TYPE__ _wchar_t;
typedef int _wchar_t;
#endif

typedef int _wint_t;
typedef int _wctype_t;

/* A size is 4 bytes */

#if defined(__SIZE_TYPE__)
Expand Down
3 changes: 3 additions & 0 deletions arch/z16/include/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ typedef __WCHAR_TYPE__ _wchar_t;
typedef int _wchar_t;
#endif

typedef int _wint_t;
typedef int _wctype_t;

/* A size is 4 bytes */

#if defined(__SIZE_TYPE__)
Expand Down
3 changes: 3 additions & 0 deletions arch/z80/include/ez80/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ typedef __WCHAR_TYPE__ _wchar_t;
typedef int _wchar_t;
#endif

typedef int _wint_t;
typedef int _wctype_t;

/* A pointer is 2 or 3 bytes, depending upon if the ez80 is in z80
* compatibility mode or not
*
Expand Down
3 changes: 3 additions & 0 deletions arch/z80/include/z180/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ typedef __WCHAR_TYPE__ _wchar_t;
typedef int _wchar_t;
#endif

typedef int _wint_t;
typedef int _wctype_t;

/* A size is 2 bytes */

#if defined(__SIZE_TYPE__)
Expand Down
3 changes: 3 additions & 0 deletions arch/z80/include/z8/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ typedef __WCHAR_TYPE__ _wchar_t;
typedef int _wchar_t;
#endif

typedef int _wint_t;
typedef int _wctype_t;

/* A size is 2 bytes */

#if defined(__SIZE_TYPE__)
Expand Down
3 changes: 3 additions & 0 deletions arch/z80/include/z80/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ typedef __WCHAR_TYPE__ _wchar_t;
typedef int _wchar_t;
#endif

typedef int _wint_t;
typedef int _wctype_t;

/* A size is 2 bytes */

#if defined(__SIZE_TYPE__)
Expand Down
4 changes: 2 additions & 2 deletions include/sys/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,14 @@ typedef _wchar_t wchar_t;
* An integral type capable of storing any valid value of wchar_t, or WEOF.
*/

typedef int wint_t;
typedef _wint_t wint_t;

/* wctype_t
* A scalar type of a data object that can hold values which represent
* locale-specific character classification.
*/

typedef int wctype_t;
typedef _wctype_t wctype_t;

#if defined(CONFIG_FS_LARGEFILE)
/* Large file versions */
Expand Down

0 comments on commit 5d9aa53

Please sign in to comment.