Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PellesC] missing '_tcsnccmp' #7398

Merged
merged 2 commits into from Jul 16, 2021
Merged

[PellesC] missing '_tcsnccmp' #7398

merged 2 commits into from Jul 16, 2021

Conversation

gvanem
Copy link
Contributor

@gvanem gvanem commented Jul 15, 2021

PellesC compiler (ver. 10) does not have this macro in it's <tchar.h>.
But it has _tcsncmp which in MSVC <tchar.h> header is defined exactly the same for UNICODE:

#define _tcsnccmp       wcsncmp
#define _tcsncmp        wcsncmp

PellesC compiler does not have this macro in it's `<tchar.h>`
@MarcelRaad
Copy link
Member

@MarcelRaad MarcelRaad commented Jul 15, 2021

Why not use _tcsncmp instead of _tcsnccmp then? It shouldn't matter here if bytes or characters are compared, should it?

@gvanem
Copy link
Contributor Author

@gvanem gvanem commented Jul 15, 2021

@MarcelRaad Agreed. But in case _MBCS is defined, this macro should call _mbsncmp().
But I'm not familiar with the difference of _strncmp() and _mbsncmp().

@MarcelRaad
Copy link
Member

@MarcelRaad MarcelRaad commented Jul 15, 2021

Disregarding that we don't care about MCBS anywhere, I think the more important difference is _tcsnccmp (_mbsncmp) vs. _tcsncmp (_mbsnbcmp). _mbsncmp does a per-character comparison and _mbsnbcmp does a per-byte comparison. That difference shouldn't matter here as we only want to know if some string is equal to some ASCII string, neither order nor non-ASCII characters matter.

Revert previous change for PellesC. 

Instead replace all use of `_tcsnccmp()` with `_tcsncmp()`.
@gvanem gvanem merged commit c6fd7cb into master Jul 16, 2021
51 of 58 checks passed
@jay jay deleted the PellesC_tcsnccmp branch Jul 16, 2021
jay referenced this issue Jul 16, 2021
PellesC compiler does not have this macro in it's `<tchar.h>`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants