Incorrect declaration of functions

Here you can report bugs found in Far Manager.
Locked
acker
Posts: 6
Joined: Mon Nov 12, 2007 6:34 pm

Incorrect declaration of functions

Post by acker »

Hi,

I've wondered why FAR when it's compiled with Visual C isn't built with /DUNICODE /D_UNICODE and with this occasion I've found some minor errors in the declarations of this functions:

In farwinapi.cpp:

Code: Select all

BOOL WINAPI FAR_CharToOemBuff(LPCSTR lpszSrc,LPTSTR lpszDst,DWORD cchDstLength)
{
  return CharToOemBuff(lpszSrc,lpszDst,cchDstLength);
}
but @msdn

Code: Select all

BOOL CharToOemBuff(      
    LPCTSTR lpszSrc,
    LPSTR lpszDst,
    DWORD cchDstLength
);
so when /DUNICODE is specified first parameter is WIDE for CharToOemBuff, but not for FAR_CharToOemBuff.
Similar for

Code: Select all

BOOL WINAPI FAR_CharToOem(LPCSTR lpszSrc,LPTSTR lpszDst)
{
  return CharToOem(lpszSrc,lpszDst);
}

Code: Select all

BOOL CharToOem(      
    LPCTSTR lpszSrc,
    LPSTR lpszDst
);

Anyway, is there a special reason not to mark the entire build as UNICODE,_UNICODE?


Best regards
User avatar
t-rex
Admin
Posts: 417
Joined: Sun Mar 20, 2005 6:10 pm
Location: Ashdod
Contact:

Post by t-rex »

acker
You're not supposed to build it with /DUNICODE, it wasn't designed that way.
Locked