Danny Backx wrote:
> Functions like swprintf are in coredll.dll, and should be described in
> stdlib.h, says http://msdn2.microsoft.com/en-us/library/ms860374.aspx .
> 
> In mingw32ce, we do have a definition for it, but we don't in cegcc :
> dannypc: {442} fgrep
> swprintf /opt/mingw32ce/arm-wince-mingw32ce/include/{*,*/*}.h
> /opt/mingw32ce/arm-wince-mingw32ce/include/stdio.h:_CRTIMP int __cdecl
> swprintf (wchar_t*, const wchar_t*, ...);
> /opt/mingw32ce/arm-wince-mingw32ce/include/stdio.h:_CRTIMP int __cdecl
> vswprintf (wchar_t*, const wchar_t*, __VALIST);
> /opt/mingw32ce/arm-wince-mingw32ce/include/tchar.h:#define
> _stprintf       swprintf
> /opt/mingw32ce/arm-wince-mingw32ce/include/tchar.h:#define _vstprintf
> vswprintf
> /opt/mingw32ce/arm-wince-mingw32ce/include/wchar.h:_CRTIMP int __cdecl
> swprintf (wchar_t*, const wchar_t*, ...);
> /opt/mingw32ce/arm-wince-mingw32ce/include/wchar.h:_CRTIMP int __cdecl
> vswprintf (wchar_t*, const wchar_t*, __VALIST);
> dannypc: {443} fgrep
> swprintf /opt/cegcc/arm-wince-cegcc/include/{*,*/*}.h
> dannypc: {444} 
> 
> Shouldn't we add these functions to src/w32api/include/stdlib.h ?

This file doesn't exist.  For cegcc, the crt functions are declared
in newlib.  For mingw32ce, they are declared in src/mingw/include.

> 
> When I say "these" I mean all the ones in tchar.h that we don't have
> yet.
> 

This could be problematic.  Eg:  sprintf from newlib accepts a few
c99 formatters, while coredll doesn't, which means you would get a discrepancy
between the sprintf/swprintf.  E.g.:  %lld.
Another problem, that would be more serious, is, the stdio implementation from
newlib isn't compatible with the coredll version.  That is, calling fwprintf
on a FILE* opened by fopen would probably crash.  I don't know if newlib
supports wide versions of the stdio functions.  If it does, we could use those
instead.

When you use cegcc, you are programming on an abstraction on top of coredll.
The original newlib usage came from a need to develop console/server apps,
usually ports of unix software.  I really recommend to switch to mingw32ce
for new apps and ports.

Cheers,
Pedro Alves


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Cegcc-devel mailing list
Cegcc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cegcc-devel

Reply via email to