linux windows.h,Windows.h和Windows.h的区别

转载地址:http://stackoverflow.com/questions/15466613/lowercase-windows-h-and-uppercase-windows-h-difference

google得知:acceptedThere is no difference, and nor could there be as file names on windows (NTFS) are case insensitive.

Actually, according to Filenames are Case Sensitive on NTFS Volumes NTFS has two different modes where one is case sensitive:NTFS supports two slightly different modes of operation that can be selected by the subsystem of the application interacting with NTFS. The first is fully case sensitive and demands that file names supplied by the application match the names stored on disk including case if the file on disk is to be selected. The second mode of operation is case preserving but not case sensitive. This means that applications can select files on the disk even if the supplied name differs in case from the name stored on the disk. Note that both modes preserve the case used to create the files. The difference in behavior noted here applies only when an application needs to locate an existing file. POSIX takes advantage of the full case sensitive mode, while MS-DOS, WOW, and Win32 subsystems use the case insensitive mode.

The file systems on Windows are case insensitve so either one will work when compiling on Windows. However, if you were to compile on Linux using the MinGW cross compiler for example, the case would matter.

The MinGW windows.h header always seems to be lower case.

The Windows.h file provided with Microsoft's tools have used a variety of cases.old VC++ installations (VC++98 and earlier) appear to install WINDOWS.H - all caps

newer VC++ installations and Windows SDKs seem to use Windows.h

some mobile device SDKs (PocketPC or Windows mobile) use windows.h - all lowercase.

Since windows.h will always work on both Windows and a Linux cross compile, I'd use #include  if I ever thought about it. Which I can't recall doing until answering this.

I wouldn't worry about this too much. Even if the capitalized form finds its way onto a Linux MinGW build, an easy (if maybe annoying) fix is to create a Windows.h file that just turns around and includeswindows.h.

简单来说:

主要是文件操作系统问题,如果文件操作系统对大小写不敏感(eg:Windows),则这两者无区别。

如果文件操作系统对大小写敏感(eg:Linux),则两者就有区别了。

对Windows系统来说,两者没有区别。大写的Windows.h主要用在SDK编程上。

对Linux系统来说,两者就有区别的。Linux上用小写的windows.h。

也就是说,在任何情况下,用小写的windows.h应该都是没有问题的。

以上纯属个人观点。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值