Skip to content

Commit 88c7f06

Browse files
kikairoyatomtor
authored andcommitted
[Clang] [Cygwin] wint_t is unsigned int (llvm#143117)
On Cygwin environment, wint_t is unsigned int as shown here: ``` $ echo | gcc -m32 -xc - -E -dM | grep WINT_T 145:#define __SIZEOF_WINT_T__ 4 315:#define __WINT_TYPE__ unsigned int ``` ``` $ echo | gcc -xc - -E -dM | grep WINT_T 147:#define __SIZEOF_WINT_T__ 4 317:#define __WINT_TYPE__ unsigned int ``` ``` $ LANG=C gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-cygwin/15/lto-wrapper.exe Target: x86_64-pc-cygwin (snip) ```
1 parent 62de7a1 commit 88c7f06

File tree

3 files changed

+430
-6
lines changed

3 files changed

+430
-6
lines changed

clang/lib/Basic/Targets/X86.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,7 @@ class LLVM_LIBRARY_VISIBILITY CygwinX86_32TargetInfo : public X86_32TargetInfo {
647647
CygwinX86_32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
648648
: X86_32TargetInfo(Triple, Opts) {
649649
this->WCharType = TargetInfo::UnsignedShort;
650+
this->WIntType = TargetInfo::UnsignedInt;
650651
DoubleAlign = LongLongAlign = 64;
651652
resetDataLayout("e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64-"
652653
"i128:128-f80:32-n8:16:32-a:0:32-S32",
@@ -982,6 +983,7 @@ class LLVM_LIBRARY_VISIBILITY CygwinX86_64TargetInfo : public X86_64TargetInfo {
982983
CygwinX86_64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
983984
: X86_64TargetInfo(Triple, Opts) {
984985
this->WCharType = TargetInfo::UnsignedShort;
986+
this->WIntType = TargetInfo::UnsignedInt;
985987
}
986988

987989
void getTargetDefines(const LangOptions &Opts,

0 commit comments

Comments
 (0)