Module: wine Branch: master Commit: 0512829a27b6401610545ed15ab6cbc83097070c URL: http://source.winehq.org/git/wine.git/?a=commit;h=0512829a27b6401610545ed15a...
Author: Nikolay Sivov nsivov@codeweavers.com Date: Tue Mar 8 22:41:07 2011 +0300
msvcrt: Add _get_output_format() and return default value.
---
dlls/msvcr100/msvcr100.spec | 2 +- dlls/msvcr80/msvcr80.spec | 2 +- dlls/msvcr90/msvcr90.spec | 2 +- dlls/msvcrt/misc.c | 9 +++++++++ dlls/msvcrt/msvcrt.h | 3 +++ dlls/msvcrt/msvcrt.spec | 2 +- dlls/msvcrt/tests/headers.c | 1 + dlls/msvcrt/tests/printf.c | 17 +++++++++++++++++ include/msvcrt/stdio.h | 4 ++++ 9 files changed, 38 insertions(+), 4 deletions(-)
diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec index d732d69..1570fd4 100644 --- a/dlls/msvcr100/msvcr100.spec +++ b/dlls/msvcr100/msvcr100.spec @@ -684,7 +684,7 @@ @ cdecl _get_heap_handle() msvcrt._get_heap_handle @ cdecl _get_invalid_parameter_handler() msvcrt._get_invalid_parameter_handler @ cdecl _get_osfhandle(long) msvcrt._get_osfhandle -@ stub _get_output_format +@ cdecl _get_output_format() msvcrt._get_output_format @ stub _get_pgmptr @ stub _get_printf_count_output @ stub _get_purecall_handler diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec index 1631fdb..65f9510 100644 --- a/dlls/msvcr80/msvcr80.spec +++ b/dlls/msvcr80/msvcr80.spec @@ -528,7 +528,7 @@ @ cdecl _get_osfhandle(long) msvcrt._get_osfhandle @ cdecl _get_osplatform(ptr) msvcrt._get_osplatform @ stub _get_osver -@ stub _get_output_format +@ cdecl _get_output_format() msvcrt._get_output_format @ stub _get_pgmptr @ stub _get_printf_count_output @ stub _get_purecall_handler diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec index 8148caf..badfe65 100644 --- a/dlls/msvcr90/msvcr90.spec +++ b/dlls/msvcr90/msvcr90.spec @@ -518,7 +518,7 @@ @ cdecl _get_heap_handle() msvcrt._get_heap_handle @ cdecl _get_invalid_parameter_handler() msvcrt._get_invalid_parameter_handler @ cdecl _get_osfhandle(long) msvcrt._get_osfhandle -@ stub _get_output_format +@ cdecl _get_output_format() msvcrt._get_output_format @ stub _get_pgmptr @ stub _get_printf_count_output @ stub _get_purecall_handler diff --git a/dlls/msvcrt/misc.c b/dlls/msvcrt/misc.c index d37fc72..b32fdb9 100644 --- a/dlls/msvcrt/misc.c +++ b/dlls/msvcrt/misc.c @@ -253,3 +253,12 @@ void CDECL MSVCRT_qsort_s(void *base, MSVCRT_size_t nmemb, MSVCRT_size_t size, MSVCRT_mergesort(base, secondarr, size, compar, 0, nmemb-1, context); MSVCRT_free(secondarr); } + +/********************************************************************* + * _get_output_format (MSVCRT.@) + * + */ +unsigned int CDECL _get_output_format(void) +{ + return 0; +} diff --git a/dlls/msvcrt/msvcrt.h b/dlls/msvcrt/msvcrt.h index 1c7120f..311437a 100644 --- a/dlls/msvcrt/msvcrt.h +++ b/dlls/msvcrt/msvcrt.h @@ -769,6 +769,9 @@ typedef void (__cdecl *MSVCRT___sighandler_t)(int); #define MSVCRT__WRITE_ABORT_MSG 1 #define MSVCRT__CALL_REPORTFAULT 2
+/* _get_output_format return code */ +#define MSVCRT__TWO_DIGIT_EXPONENT 0x1 + void __cdecl MSVCRT_free(void*); void* __cdecl MSVCRT_malloc(MSVCRT_size_t); void* __cdecl MSVCRT_calloc(MSVCRT_size_t,MSVCRT_size_t); diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index f75c0d9..5d07736 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -473,7 +473,7 @@ @ cdecl _get_osfhandle(long) @ cdecl _get_osplatform(ptr) MSVCRT__get_osplatform # stub _get_osver -# stub _get_output_format +@ cdecl _get_output_format() # stub _get_pgmptr @ cdecl _get_sbh_threshold() # stub _get_wenviron diff --git a/dlls/msvcrt/tests/headers.c b/dlls/msvcrt/tests/headers.c index 25e2277..7c102b4 100644 --- a/dlls/msvcrt/tests/headers.c +++ b/dlls/msvcrt/tests/headers.c @@ -457,6 +457,7 @@ static void test_defines(void) CHECK_DEF(_UNDERFLOW); CHECK_DEF(_WRITE_ABORT_MSG); CHECK_DEF(_CALL_REPORTFAULT); + CHECK_DEF(_TWO_DIGIT_EXPONENT); }
#endif /* __WINE_USE_MSVCRT */ diff --git a/dlls/msvcrt/tests/printf.c b/dlls/msvcrt/tests/printf.c index ddf4801..22ad1f6 100644 --- a/dlls/msvcrt/tests/printf.c +++ b/dlls/msvcrt/tests/printf.c @@ -43,6 +43,7 @@ static int (__cdecl *p__ecvt_s)(char *buffer, size_t length, double number, int ndigits, int *decpt, int *sign); static int (__cdecl *p__fcvt_s)(char *buffer, size_t length, double number, int ndigits, int *decpt, int *sign); +static unsigned int (__cdecl *p__get_output_format)(void);
static void init( void ) { @@ -53,6 +54,7 @@ static void init( void ) p__vsnwprintf_s = (void *)GetProcAddress(hmod, "_vsnwprintf_s"); p__ecvt_s = (void *)GetProcAddress(hmod, "_ecvt_s"); p__fcvt_s = (void *)GetProcAddress(hmod, "_fcvt_s"); + p__get_output_format = (void *)GetProcAddress(hmod, "_get_output_format"); }
static void test_sprintf( void ) @@ -1013,6 +1015,20 @@ static void test_vsnwprintf_s(void) ok( !wcscmp(out1, buffer), "buffer wrong, got=%s\n", wine_dbgstr_w(buffer)); }
+static void test__get_output_format(void) +{ + unsigned int ret; + + if (!p__get_output_format) + { + win_skip("_get_output_format not available\n"); + return; + } + + ret = p__get_output_format(); + ok(ret == 0, "got %d\n", ret); +} + START_TEST(printf) { init(); @@ -1026,4 +1042,5 @@ START_TEST(printf) test_vscprintf(); test_vscwprintf(); test_vsnwprintf_s(); + test__get_output_format(); } diff --git a/include/msvcrt/stdio.h b/include/msvcrt/stdio.h index fa5290f..c167110 100644 --- a/include/msvcrt/stdio.h +++ b/include/msvcrt/stdio.h @@ -94,6 +94,9 @@ FILE* __cdecl __iob_func(void); #define stdout (_iob+STDOUT_FILENO) #define stderr (_iob+STDERR_FILENO)
+/* return value for _get_output_format */ +#define _TWO_DIGIT_EXPONENT 0x1 + #ifndef _STDIO_DEFINED #define _STDIO_DEFINED int __cdecl _fcloseall(void); @@ -173,6 +176,7 @@ int __cdecl vprintf(const char*,__ms_va_list); int __cdecl vprintf_s(const char*,__ms_va_list); int __cdecl vsprintf(char*,const char*,__ms_va_list); int __cdecl vsprintf_s(char*,size_t,const char*,__ms_va_list); +unsigned int __cdecl _get_output_format(void);
#ifndef _WSTDIO_DEFINED #define _WSTDIO_DEFINED