#2186 PCTSTR not defined

WSL
unread
nobody
WSL (6)
Bug
none
Unknown
False
2014-02-24
2014-02-23
No

The MinGW win32 headers only define LPCTSTR but not PCTSTR. These have the same definition in winnt.h, so it's only a small inconvenience for existing code that uses PCTSTR (which is a legacy definition).
Nevertheless I think the definition should be in the headers to avoid unnecessary work getting existing Windows code to compile with MinGW.

Discussion

  • Keith Marshall

    Keith Marshall - 2014-02-23

    But why use these insane Microsoft specific types, in the first place, when there's a perfectly good ISO-C standard equivalent? Of course, Microsoft love it when you do so, because it engenders lock-in to their ghastly OS; developers who follow this lead must be masochists, so should relish the burden of the unnecessary work anyway.

    Okay, I'll get off my hobby horse now. Since this is a typedef conditioned on UNICODE, my argument may not be strictly relevant anyhow. Looks like PCTSTR has been missing from MinGW headers forever -- at least there's no sign of it in my end-of-line CVS backup for w32api-3.x, nor in WSL-4.x. I guess it's an unintentional omission, and we should add it.

    For reference documentation: http://msdn.microsoft.com/en-us/library/windows/desktop/aa383751%28v=vs.85%29.aspx

     
  • Erik Larsson

    Erik Larsson - 2014-02-24

    Well, I couldn't agree with you more regarding all these insane Microsoft-specific typedefs but unfortunately existing code does use them because they're in the Windows API headers. :-)

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks