[EMAIL PROTECTED] wrote:
> Revision: 809
>           http://svn.sourceforge.net/cegcc/?rev=809&view=rev
> Author:   dannybackx
> Date:     2006-11-17 23:45:23 -0800 (Fri, 17 Nov 2006)
>
>   

> Modified: trunk/cegcc/src/w32api/ChangeLog.ce
> ===================================================================
> --- trunk/cegcc/src/w32api/ChangeLog.ce       2006-11-16 14:25:37 UTC (rev 
> 808)
> +++ trunk/cegcc/src/w32api/ChangeLog.ce       2006-11-18 07:45:23 UTC (rev 
> 809)
> @@ -1,3 +1,9 @@
> +2006-11-18  Danny Backx  <[EMAIL PROTECTED]>
> +
> +     * include/winbase.h (lstrcpy, lstrcat, lstrlen) : Add prototypes
> +     for the functions pointed to.
> +     * include/winbase.h (lstrcpy) : Fix typo.
> +
>
>   

> Modified: trunk/cegcc/src/w32api/include/winbase.h
> ===================================================================
> --- trunk/cegcc/src/w32api/include/winbase.h  2006-11-16 14:25:37 UTC (rev 
> 808)
> +++ trunk/cegcc/src/w32api/include/winbase.h  2006-11-18 07:45:23 UTC (rev 
> 809)
> @@ -2459,10 +2459,14 @@
>  #ifdef _WIN32_WCE
>  #include <kfuncs.h>
>  
>   


> -#define      lstrcpyW        wscpy
> +#define      lstrcpyW        wcscpy
>  #define lstrcatW     wcscat
>  #define lstrlenW     wcslen
>   
According to MSDN, these are fine here.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/resources/strings/stringreference/stringfunctions/lstrcpy.asp

Probably missing are the:

#ifdef UNICODE
#define lstrcpy lstrcpyW
#else
#define lstrcpy lstrcpyA
#endif

---

> +wchar_t *wcscpy(wchar_t *dest, const wchar_t *src);
> +wchar_t *wcscat(wchar_t *dest, const wchar_t *src);
> +size_t wcslen(const wchar_t *string);
> +
>   

The above, are std c (not win32 api) functions already defined in 
mingw/include.
The discriminating hint is that opengroup describes them:
http://www.opengroup.org/onlinepubs/007908799/xsh/wcslen.html

These MSDN links say they should go to stdio.h and string.h.
http://msdn2.microsoft.com/en-gb/library/ms860384.aspx
http://msdn2.microsoft.com/en-us/library/ms860442.aspx

And we indeed have definitions for them in mingw/include.

The test below compiled with g++ shows that we don't need to add those 
declarations there.
The compiler is pickier in that it insists on having seen the 
declarations, while gcc doesn't.
In this case, it didn't complain.

---
#include <windows.h>

int main (int argc, char** argv)
{
   wchar_t *buf1, *buf2;
   wcscpy (buf1, buf2);
   wcscat (buf1, buf2);
   return wcslen (L"asdfasdf");
}
---
$arm-wince-mingw32ce-g++ main.cpp -o main.exe
$ (no output)

Have you seen a real need to put those std c definitions there? If so, 
we probably miss an include somewhere,
else, I'd rather remove them from winbase.h.

Cheers,
Pedro Alves



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Cegcc-devel mailing list
Cegcc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cegcc-devel

Reply via email to