Skip to content

Commit f04fcd4

Browse files
kikairoyajeremyd2019
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 1f68a1f commit f04fcd4

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
@@ -637,6 +637,7 @@ class LLVM_LIBRARY_VISIBILITY CygwinX86_32TargetInfo : public X86_32TargetInfo {
637637
CygwinX86_32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
638638
: X86_32TargetInfo(Triple, Opts) {
639639
this->WCharType = TargetInfo::UnsignedShort;
640+
this->WIntType = TargetInfo::UnsignedInt;
640641
DoubleAlign = LongLongAlign = 64;
641642
resetDataLayout("e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64-"
642643
"i128:128-f80:32-n8:16:32-a:0:32-S32",
@@ -948,6 +949,7 @@ class LLVM_LIBRARY_VISIBILITY CygwinX86_64TargetInfo : public X86_64TargetInfo {
948949
CygwinX86_64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
949950
: X86_64TargetInfo(Triple, Opts) {
950951
this->WCharType = TargetInfo::UnsignedShort;
952+
this->WIntType = TargetInfo::UnsignedInt;
951953
}
952954

953955
void getTargetDefines(const LangOptions &Opts,

0 commit comments

Comments
 (0)