Commit graph

31 commits

Author SHA1 Message Date
Sylvain Petreolle
b30bf6de31 [CRT]
- Update file.c to recent wine. (now with locking!)
- implement/enable __wcserror, __wcserror_s, _access_s, _ctime32_s, _ctime64_s,
_cwprintf, _fseeki64, _ftelli64, _get_osplatform, _get_output_format,
_get_pgmptr, _get_wpgmptr, _get_terminate, _get_tzname, _get_unexpected,
_gmtime64_s, _i64toa_s, _i64tow_s, _initterm_e, _itoa_s, _itow_s,
_localtime32_s, _localtime64_s, _ltoa_s, _ltow_s, _putwch, _searchenv_s,
_sopen_s, _ui64toa_s, _ui64tow_s, _vcwprintf, _vsprintf_p, _waccess_s,
_wcserror, _wcserror_s, _wfopen_s, _wsopen_s, fopen_s, fprintf_s, fwprintf_s,
printf_s, strerror_s, strncpy_s, strtok_s, vfprintf_s, vfwprintf_s, vprintf_s,
vwprintf_s, wcscat_s, wcsncat_s, wcstok_s, wprintf_s. Most code comes from
wine.
- Fix __set_errno -> _set_errno and export it.
- Remove unneeded files.
[CRT_HEADERS]
- add threadmbcinfo struct.
- update some sec_api headers from mingw64 due to missing or incorrect
functions.

Patch by Samuel Serapion.
Changes to msvcrt spec by me due to winebuild.
CRLF/LF fixes.

svn path=/trunk/; revision=54651
2011-12-14 22:09:24 +00:00
Thomas Faber
cbab266b08 [CRT]
- Remove some differences to Wine. Fixes comparing a char against EOF in fgetwc.

svn path=/trunk/; revision=54494
2011-11-24 13:27:34 +00:00
Timo Kreuzer
3e2fddbe19 [CRT]
- Implement MSVC versions of call_copy_ctor, call_dtor, continue_after_catch, __CxxFrameHandler
- Fix amd64 versions of _control87 and _statusfp
- Fix MSVC and amd64 warnings

svn path=/trunk/; revision=53713
2011-09-15 17:11:53 +00:00
Timo Kreuzer
c952a3638e [CRT]
- Remove duplicated functions
- Fix MSVC amd64 build
- cleanup the cmake file a little
- creadit wine for their code

svn path=/trunk/; revision=53320
2011-08-19 18:10:17 +00:00
Colin Finck
7ffb757e8b [CRT]
- Revert 38185 which synced fputwc to the Wine version for the sake of fixing Winetests.
  This removed the implicit ANSI conversion, which was honestly checking the wrong flags. The new version correctly checks for WX_TEXT and only does the conversion in this case. This way we also don't fail any additional Winetests.
- Simplify streamout_char in the new printf implementation and use _fputtc instead of _flsbuf.
  This way, we correctly do an implicit ANSI conversion when required.
- Fix fgetwc declaration.

Thanks to Timo for many hints and assistance. Most of this code is actually his idea :-)
Thanks to Olaf for providing a build server to speed up my code tests.

See issue #6007 for more details.

svn path=/trunk/; revision=51058
2011-03-15 23:45:38 +00:00
Timo Kreuzer
7397aa09ad [CRT]
Get rid of the old printf code and some unused functions. 3346 lines of code less.

svn path=/trunk/; revision=50355
2011-01-11 13:13:47 +00:00
Timo Kreuzer
79ec14277f [CRT]
- Rewrite broken _flsbuf and implement _flswbuf
- use _flswbuf in wstreamout
- Fixes broken text output in dwnl etc

svn path=/trunk/; revision=50290
2011-01-04 22:22:13 +00:00
Timo Kreuzer
bf49c46b23 [CRT]
New implementation of all printf functions. It's stream based (like MS one is) rather than buffer based (like our old is). Floating point is not 100% finished, but current implementation is good enough to boot. It can be enabled by a config switch.

svn path=/trunk/; revision=49499
2010-11-05 22:21:36 +00:00
Christoph von Wittich
2097d927f1 [CRT]
sync fseek with wine 1.1.40 (all msvcrt file tests pass now)

svn path=/trunk/; revision=45952
2010-03-06 15:51:12 +00:00
Christoph von Wittich
dd3fc3f8e7 [CRT]
sync read_i with wine 1.1.40

svn path=/trunk/; revision=45948
2010-03-06 14:53:55 +00:00
Christoph von Wittich
2def6506a9 fix all msvcrt file winetests
svn path=/trunk/; revision=43522
2009-10-16 21:43:28 +00:00
Christoph von Wittich
59ee8d397a -sync msvcrt_init_io to wine 1.1.31
fixes 12 msvcrt file winetests

svn path=/trunk/; revision=43520
2009-10-16 20:57:00 +00:00
Gregor Schneider
d2c4562d5b Free memory on error
svn path=/trunk/; revision=42618
2009-08-11 14:37:52 +00:00
Dmitry Chapyshev
2b41ac2a04 - Implement _wfreopen, _y0, _y1, _yn
- Partially implement _j0, _j1, _jn
All from Wine.

svn path=/trunk/; revision=40778
2009-05-03 14:57:56 +00:00
Jeffrey Morlan
5f17f63202 In the CRT, replaced __set_errno calls having Win32 error codes as their argument with _dosmaperr.
svn path=/trunk/; revision=39862
2009-03-04 07:39:44 +00:00
Gregor Schneider
f45ee646df - Update fputwc implementation to current wine sources
- Fixes 23 msvcrt file winetests

svn path=/trunk/; revision=38185
2008-12-19 16:57:48 +00:00
Gregor Schneider
855ea53e48 - Fix return values for fputc and _flsbuf: return only one char
- Fixes three msvcrt file winetests

svn path=/trunk/; revision=38184
2008-12-19 11:39:04 +00:00
Timo Kreuzer
76a198afb9 Update crt headers and mingw lib from mingw64. Update crt a bit. 4 msvcrt time tests fixed.
svn path=/trunk/; revision=38052
2008-12-13 21:28:05 +00:00
Dmitry Gorbachev
32580ec32a Silence GCC warnings.
svn path=/trunk/; revision=37919
2008-12-07 21:52:22 +00:00
Gregor Schneider
ea4870e585 Free allocated resource on error, CID 1358.
svn path=/trunk/; revision=37853
2008-12-04 16:46:54 +00:00
Art Yerkes
c261b9dbe8 Fix leaks reported by coverity 612-615. In each case, it'd be safe to free
NULL, and failure to allocate isn't the only dropthrough case, leading to
conversion buffer leaks.

svn path=/trunk/; revision=36480
2008-09-24 13:35:37 +00:00
Aleksey Bragin
966a7b788f - Silence crt's "wtf".
svn path=/trunk/; revision=34897
2008-07-28 11:30:08 +00:00
Aleksey Bragin
9db3c82bb7 - Sync with Wine (null-initializing some exported data).
svn path=/trunk/; revision=34805
2008-07-26 11:45:59 +00:00
Jeffrey Morlan
d9c376b18d Fix memory leak in vfwprintf: Don't change 'mem' pointer before freeing it.
svn path=/trunk/; revision=34609
2008-07-20 16:48:24 +00:00
Colin Finck
248d39652c - Remove 2 wrong versions of wctomb and 2 wrong versions of wcstombs
- Implement new versions of wctomb and wcstombs, which consider the language set by setlocale() and work according to all behaviours I could find when testing under WinXP SP2.
  This was tested with an own test suite (which I can commit as well if anyone is interested)
- Do a real conversion to MultiByte characters using wctomb in fputwc and vfwprintf. (verified under WinXP SP2)
- Set 'MSVCRT___lc_codepage' and 'MSVCRT___lc_collate_cp' to 1252 by default ("C" locale) and not the current active codepage (which might not work with i.e. Eastern codepages)
- Add a new check for 'MultiByteCount < 0' to WideCharToMultiByte (also verified under WinXP SP2)
- Change MB_LEN_MAX back to 2, the value 5 only applies to newer CRT's (msvcrt only handles single-byte and double-byte characters)
- Don't compile the Wine-imported 'wcscpy_s', it isn't available in msvcrt

svn path=/trunk/; revision=34557
2008-07-16 21:40:09 +00:00
Colin Finck
d1a42af5b7 Simplify the code for fputwc, when the file is opened in text mode.
I verified this behaviour with a test app under Windows XP SP2. This is also the code used by the fputwc function of our previous msvcrt.

svn path=/trunk/; revision=34266
2008-07-02 16:07:01 +00:00
Johannes Anderwald
eb0b862540 - check for a valid file descriptor
svn path=/trunk/; revision=34070
2008-06-24 12:42:22 +00:00
Aleksey Bragin
3ee18cdb67 - Provide a real fix for fwprintf and fputwc in case the output stream is in TEXT mode by doing a widechar to multibyte conversion.
- This should be submitted to Wine to close their bug.
See issue #3353 for more details.

svn path=/trunk/; revision=34042
2008-06-21 15:58:00 +00:00
Aleksey Bragin
cdd5ae5641 - vsn[w]printf -> _vsn[w]printf.
svn path=/trunk/; revision=34038
2008-06-21 10:00:59 +00:00
Aleksey Bragin
7b57917c46 - Completely rewrite most of stdio functions by merging Wine's msvcrt code adapted for ReactOS.
- Leave and refactor existing underlying linux-code based sprintf implementation into lnx_ prefixed functions.
- Misc source code and headers cleanup.
- Fixes bugs 2910, 2803.
See issue #2803 for more details.

svn path=/trunk/; revision=33927
2008-06-11 08:54:46 +00:00
Aleksey Bragin
45ebe0ccc2 - Update many parts of CRT, and misc cleanup.
- Largely based on the patch by Samuel Serapion.
- Include file.c from Wine's msvcrt, but exclude its contents from the build process for now.

svn path=/trunk/; revision=33866
2008-06-06 17:49:24 +00:00