Commit 0edef50d authored by Alexandre Julliard's avatar Alexandre Julliard

msvcrt: Use the public standard type definitions where possible in msvcrt.h.

parent 34422eb5
......@@ -22,6 +22,7 @@
*/
#include <stdarg.h>
#include <direct.h>
#include "windef.h"
#include "winbase.h"
......@@ -318,7 +319,7 @@ int CDECL MSVCRT__chdrive(int newdrive)
*/
int CDECL MSVCRT__findclose(MSVCRT_intptr_t hand)
{
TRACE(":handle %ld\n",hand);
TRACE(":handle %Iu\n",hand);
if (!FindClose((HANDLE)hand))
{
msvcrt_set_errno(GetLastError());
......@@ -937,7 +938,7 @@ MSVCRT_wchar_t* CDECL MSVCRT__wgetdcwd(int drive, MSVCRT_wchar_t * buf, int size
* NOTES
* See GetLastError().
*/
unsigned int CDECL MSVCRT__getdiskfree(unsigned int disk, struct MSVCRT__diskfree_t * d)
unsigned int CDECL MSVCRT__getdiskfree(unsigned int disk, struct _diskfree_t * d)
{
WCHAR drivespec[] = {'@', ':', '\\', 0};
DWORD ret[4];
......
......@@ -460,7 +460,7 @@ void CDECL _seterrormode(int mode)
* _invalid_parameter (MSVCRT.@)
*/
void __cdecl MSVCRT__invalid_parameter(const MSVCRT_wchar_t *expr, const MSVCRT_wchar_t *func,
const MSVCRT_wchar_t *file, unsigned int line, MSVCRT_uintptr_t arg)
const MSVCRT_wchar_t *file, unsigned int line, uintptr_t arg)
{
#if _MSVCR_VER >= 140
thread_data_t *data = msvcrt_get_thread_data();
......@@ -475,7 +475,7 @@ void __cdecl MSVCRT__invalid_parameter(const MSVCRT_wchar_t *expr, const MSVCRT_
if (invalid_parameter_handler) invalid_parameter_handler( expr, func, file, line, arg );
else
{
ERR( "%s:%u %s: %s %lx\n", debugstr_w(file), line, debugstr_w(func), debugstr_w(expr), arg );
ERR( "%s:%u %s: %s %Ix\n", debugstr_w(file), line, debugstr_w(func), debugstr_w(expr), arg );
#if _MSVCR_VER >= 80
RaiseException( STATUS_INVALID_CRUNTIME_PARAMETER, EXCEPTION_NONCONTINUABLE, 0, NULL );
#endif
......
......@@ -2527,7 +2527,7 @@ int CDECL MSVCRT__open_osfhandle(MSVCRT_intptr_t handle, int oflags)
flags |= split_oflags(oflags);
fd = msvcrt_alloc_fd((HANDLE)handle, flags);
TRACE(":handle (%ld) fd (%d) flags 0x%08x\n", handle, fd, flags);
TRACE(":handle (%Iu) fd (%d) flags 0x%08x\n", handle, fd, flags);
return fd;
}
......@@ -4402,7 +4402,7 @@ MSVCRT_size_t CDECL MSVCRT__fread_nolock_s(void *buf, MSVCRT_size_t buf_size, MS
{
size_t bytes_left, buf_pos;
TRACE("(%p %lu %lu %lu %p)\n", buf, buf_size, elem_size, count, stream);
TRACE("(%p %Iu %Iu %Iu %p)\n", buf, buf_size, elem_size, count, stream);
if(!MSVCRT_CHECK_PMT(stream != NULL)) {
if(buf && buf_size)
......@@ -4540,7 +4540,7 @@ int CDECL MSVCRT_freopen_s(MSVCRT_FILE** pFile,
/*********************************************************************
* fsetpos (MSVCRT.@)
*/
int CDECL MSVCRT_fsetpos(MSVCRT_FILE* file, MSVCRT_fpos_t *pos)
int CDECL MSVCRT_fsetpos(MSVCRT_FILE* file, fpos_t *pos)
{
int ret;
......@@ -4646,7 +4646,7 @@ LONG CDECL MSVCRT__ftell_nolock(MSVCRT_FILE* file)
/*********************************************************************
* fgetpos (MSVCRT.@)
*/
int CDECL MSVCRT_fgetpos(MSVCRT_FILE* file, MSVCRT_fpos_t *pos)
int CDECL MSVCRT_fgetpos(MSVCRT_FILE* file, fpos_t *pos)
{
*pos = MSVCRT__ftelli64(file);
if(*pos == -1)
......
......@@ -148,12 +148,12 @@ void* CDECL DECLSPEC_HOTPATCH MSVCRT_operator_new(MSVCRT_size_t size)
retval = msvcrt_heap_alloc(0, size);
if(retval)
{
TRACE("(%ld) returning %p\n", size, retval);
TRACE("(%Iu) returning %p\n", size, retval);
return retval;
}
} while(_callnewh(size));
TRACE("(%ld) out of memory\n", size);
TRACE("(%Iu) out of memory\n", size);
#if _MSVCR_VER >= 80
throw_exception(EXCEPTION_BAD_ALLOC, 0, "bad allocation");
#endif
......@@ -334,7 +334,7 @@ int CDECL _heapset(unsigned int value)
*/
int CDECL _heapadd(void* mem, MSVCRT_size_t size)
{
TRACE("(%p,%ld) unsupported in Win32\n", mem,size);
TRACE("(%p,%Iu) unsupported in Win32\n", mem,size);
*MSVCRT__errno() = MSVCRT_ENOSYS;
return -1;
}
......@@ -559,7 +559,7 @@ void CDECL _aligned_free(void *memblock)
void * CDECL _aligned_offset_malloc(MSVCRT_size_t size, MSVCRT_size_t alignment, MSVCRT_size_t offset)
{
void *memblock, *temp, **saved;
TRACE("(%lu, %lu, %lu)\n", size, alignment, offset);
TRACE("(%Iu, %Iu, %Iu)\n", size, alignment, offset);
/* alignment must be a power of 2 */
if ((alignment & (alignment - 1)) != 0)
......@@ -601,7 +601,7 @@ void * CDECL _aligned_offset_malloc(MSVCRT_size_t size, MSVCRT_size_t alignment,
*/
void * CDECL _aligned_malloc(MSVCRT_size_t size, MSVCRT_size_t alignment)
{
TRACE("(%lu, %lu)\n", size, alignment);
TRACE("(%Iu, %Iu)\n", size, alignment);
return _aligned_offset_malloc(size, alignment, 0);
}
......@@ -613,7 +613,7 @@ void * CDECL _aligned_offset_realloc(void *memblock, MSVCRT_size_t size,
{
void * temp, **saved;
MSVCRT_size_t old_padding, new_padding, old_size;
TRACE("(%p, %lu, %lu, %lu)\n", memblock, size, alignment, offset);
TRACE("(%p, %Iu, %Iu, %Iu)\n", memblock, size, alignment, offset);
if (!memblock)
return _aligned_offset_malloc(size, alignment, offset);
......@@ -725,7 +725,7 @@ void * CDECL _aligned_offset_realloc(void *memblock, MSVCRT_size_t size,
*/
void * CDECL _aligned_realloc(void *memblock, MSVCRT_size_t size, MSVCRT_size_t alignment)
{
TRACE("(%p, %lu, %lu)\n", memblock, size, alignment);
TRACE("(%p, %Iu, %Iu)\n", memblock, size, alignment);
return _aligned_offset_realloc(memblock, size, alignment, 0);
}
......@@ -734,7 +734,7 @@ void * CDECL _aligned_realloc(void *memblock, MSVCRT_size_t size, MSVCRT_size_t
*/
int CDECL MSVCRT_memmove_s(void *dest, MSVCRT_size_t numberOfElements, const void *src, MSVCRT_size_t count)
{
TRACE("(%p %lu %p %lu)\n", dest, numberOfElements, src, count);
TRACE("(%p %Iu %p %Iu)\n", dest, numberOfElements, src, count);
if(!count)
return 0;
......@@ -754,7 +754,7 @@ int CDECL MSVCRT_memmove_s(void *dest, MSVCRT_size_t numberOfElements, const voi
int CDECL wmemmove_s(MSVCRT_wchar_t *dest, MSVCRT_size_t numberOfElements,
const MSVCRT_wchar_t *src, MSVCRT_size_t count)
{
TRACE("(%p %lu %p %lu)\n", dest, numberOfElements, src, count);
TRACE("(%p %Iu %p %Iu)\n", dest, numberOfElements, src, count);
if (!count)
return 0;
......@@ -777,7 +777,7 @@ int CDECL wmemmove_s(MSVCRT_wchar_t *dest, MSVCRT_size_t numberOfElements,
*/
int CDECL MSVCRT_memcpy_s(void *dest, MSVCRT_size_t numberOfElements, const void *src, MSVCRT_size_t count)
{
TRACE("(%p %lu %p %lu)\n", dest, numberOfElements, src, count);
TRACE("(%p %Iu %p %Iu)\n", dest, numberOfElements, src, count);
if(!count)
return 0;
......@@ -805,7 +805,7 @@ int CDECL MSVCRT_memcpy_s(void *dest, MSVCRT_size_t numberOfElements, const void
int CDECL wmemcpy_s(MSVCRT_wchar_t *dest, MSVCRT_size_t numberOfElements,
const MSVCRT_wchar_t *src, MSVCRT_size_t count)
{
TRACE("(%p %lu %p %lu)\n", dest, numberOfElements, src, count);
TRACE("(%p %Iu %p %Iu)\n", dest, numberOfElements, src, count);
if (!count)
return 0;
......@@ -834,7 +834,7 @@ int CDECL MSVCRT_strncpy_s(char *dest, MSVCRT_size_t numberOfElements,
{
MSVCRT_size_t i, end;
TRACE("(%p %lu %s %lu)\n", dest, numberOfElements, debugstr_a(src), count);
TRACE("(%p %Iu %s %Iu)\n", dest, numberOfElements, debugstr_a(src), count);
if(!count) {
if(dest && numberOfElements)
......
......@@ -1003,7 +1003,7 @@ int CDECL __lconv_init(void)
*/
LCID* CDECL ___lc_handle_func(void)
{
return get_locinfo()->lc_handle;
return (LCID *)get_locinfo()->lc_handle;
}
#if _MSVCR_VER >= 110
......@@ -2164,7 +2164,7 @@ BOOL msvcrt_init_locale(void)
/*********************************************************************
* wctrans (MSVCR120.@)
*/
MSVCRT_wctrans_t CDECL MSVCR120_wctrans(const char *property)
wctrans_t CDECL MSVCR120_wctrans(const char *property)
{
static const char str_tolower[] = "tolower";
static const char str_toupper[] = "toupper";
......@@ -2179,7 +2179,7 @@ MSVCRT_wctrans_t CDECL MSVCR120_wctrans(const char *property)
/*********************************************************************
* towctrans (MSVCR120.@)
*/
MSVCRT_wint_t CDECL MSVCR120_towctrans(MSVCRT_wint_t c, MSVCRT_wctrans_t category)
MSVCRT_wint_t CDECL MSVCR120_towctrans(MSVCRT_wint_t c, wctrans_t category)
{
if(category == 1)
return MSVCRT__towupper_l(c, NULL);
......
......@@ -915,7 +915,7 @@ int __cdecl event_wait_for_multiple(event **events, MSVCRT_size_t count, MSVCRT_
thread_wait *wait;
MSVCRT_size_t ret;
TRACE("(%p %ld %d %u)\n", events, count, wait_all, timeout);
TRACE("(%p %Iu %d %u)\n", events, count, wait_all, timeout);
if(count == 0)
return 0;
......
......@@ -1511,7 +1511,7 @@ MSVCRT_longlong CDECL MSVCRT_llabs( MSVCRT_longlong n )
/*********************************************************************
* imaxabs (MSVCR120.@)
*/
MSVCRT_intmax_t CDECL MSVCRT_imaxabs( MSVCRT_intmax_t n )
intmax_t CDECL MSVCRT_imaxabs( intmax_t n )
{
return n >= 0 ? n : -n;
}
......@@ -1770,7 +1770,7 @@ double CDECL MSVCRT_ldexp(double num, MSVCRT_long exp)
/*********************************************************************
* _cabs (MSVCRT.@)
*/
double CDECL MSVCRT__cabs(struct MSVCRT__complex num)
double CDECL MSVCRT__cabs(struct _complex num)
{
return MSVCRT_sqrt(num.x * num.x + num.y * num.y);
}
......@@ -2720,7 +2720,7 @@ int CDECL MSVCRT__gcvt_s(char *buff, MSVCRT_size_t size, double number, int digi
unsigned __int64 CDECL MSVCRT_div(int num, int denom)
{
union {
MSVCRT_div_t div;
div_t div;
unsigned __int64 uint64;
} ret;
......@@ -2734,9 +2734,9 @@ unsigned __int64 CDECL MSVCRT_div(int num, int denom)
* VERSION
* [!i386] Non-x86 can't run win32 apps so we don't need binary compatibility
*/
MSVCRT_div_t CDECL MSVCRT_div(int num, int denom)
div_t CDECL MSVCRT_div(int num, int denom)
{
MSVCRT_div_t ret;
div_t ret;
ret.quot = num / denom;
ret.rem = num % denom;
......@@ -2754,7 +2754,7 @@ MSVCRT_div_t CDECL MSVCRT_div(int num, int denom)
unsigned __int64 CDECL MSVCRT_ldiv(MSVCRT_long num, MSVCRT_long denom)
{
union {
MSVCRT_ldiv_t ldiv;
ldiv_t ldiv;
unsigned __int64 uint64;
} ret;
......@@ -2768,9 +2768,9 @@ unsigned __int64 CDECL MSVCRT_ldiv(MSVCRT_long num, MSVCRT_long denom)
* VERSION
* [!i386] Non-x86 can't run win32 apps so we don't need binary compatibility
*/
MSVCRT_ldiv_t CDECL MSVCRT_ldiv(MSVCRT_long num, MSVCRT_long denom)
ldiv_t CDECL MSVCRT_ldiv(MSVCRT_long num, MSVCRT_long denom)
{
MSVCRT_ldiv_t ret;
ldiv_t ret;
ret.quot = num / denom;
ret.rem = num % denom;
......@@ -2782,9 +2782,9 @@ MSVCRT_ldiv_t CDECL MSVCRT_ldiv(MSVCRT_long num, MSVCRT_long denom)
/*********************************************************************
* lldiv (MSVCR100.@)
*/
MSVCRT_lldiv_t CDECL MSVCRT_lldiv(MSVCRT_longlong num, MSVCRT_longlong denom)
lldiv_t CDECL MSVCRT_lldiv(MSVCRT_longlong num, MSVCRT_longlong denom)
{
MSVCRT_lldiv_t ret;
lldiv_t ret;
ret.quot = num / denom;
ret.rem = num % denom;
......
......@@ -80,7 +80,7 @@ int CDECL MSVCRT_rand_s(unsigned int *pval)
*/
void CDECL MSVCRT__sleep(MSVCRT_ulong timeout)
{
TRACE("_sleep for %d milliseconds\n",timeout);
TRACE("_sleep for %ld milliseconds\n",timeout);
Sleep((timeout)?timeout:1);
}
......
......@@ -21,6 +21,8 @@
#define __WINE_MSVCRT_H
#include <stdarg.h>
#include <stdint.h>
#include <wchar.h>
#include "windef.h"
#include "winbase.h"
......@@ -52,36 +54,16 @@
#define MSVCRT__MAX_EXT 256
typedef unsigned char MSVCRT_bool;
typedef unsigned short MSVCRT_wchar_t;
typedef unsigned short MSVCRT_wint_t;
typedef unsigned short MSVCRT_wctrans_t;
typedef unsigned short MSVCRT_wctype_t;
typedef unsigned short MSVCRT__ino_t;
typedef unsigned int MSVCRT__fsize_t;
typedef int MSVCRT_long;
typedef unsigned int MSVCRT_ulong;
typedef wchar_t MSVCRT_wchar_t;
typedef wint_t MSVCRT_wint_t;
typedef __msvcrt_long MSVCRT_long;
typedef __msvcrt_ulong MSVCRT_ulong;
typedef __int64 MSVCRT_longlong;
typedef long long MSVCRT_intmax_t;
#ifdef _WIN64
typedef unsigned __int64 MSVCRT_size_t;
typedef __int64 MSVCRT_intptr_t;
typedef unsigned __int64 MSVCRT_uintptr_t;
#else
typedef unsigned long MSVCRT_size_t;
typedef long MSVCRT_intptr_t;
typedef unsigned long MSVCRT_uintptr_t;
#endif
#ifdef _CRTDLL
typedef short MSVCRT__dev_t;
#else
typedef unsigned int MSVCRT__dev_t;
#endif
typedef int MSVCRT__off_t;
typedef int MSVCRT_clock_t;
typedef int MSVCRT___time32_t;
typedef __int64 DECLSPEC_ALIGN(8) MSVCRT___time64_t;
typedef __int64 DECLSPEC_ALIGN(8) MSVCRT_fpos_t;
typedef int MSVCRT_mbstate_t;
typedef size_t MSVCRT_size_t;
typedef intptr_t MSVCRT_intptr_t;
typedef __time32_t MSVCRT___time32_t;
typedef __time64_t MSVCRT___time64_t;
typedef mbstate_t MSVCRT_mbstate_t;
typedef void (__cdecl *MSVCRT_terminate_handler)(void);
typedef void (__cdecl *MSVCRT_terminate_function)(void);
......@@ -91,29 +73,13 @@ typedef void (__cdecl *MSVCRT__se_translator_function)(unsigned int code, struct
typedef void (__cdecl *MSVCRT__beginthread_start_routine_t)(void *);
typedef unsigned int (__stdcall *MSVCRT__beginthreadex_start_routine_t)(void *);
typedef int (__cdecl *MSVCRT__onexit_t)(void);
typedef void (__cdecl *MSVCRT_invalid_parameter_handler)(const MSVCRT_wchar_t*, const MSVCRT_wchar_t*, const MSVCRT_wchar_t*, unsigned, MSVCRT_uintptr_t);
typedef void (__cdecl *MSVCRT_invalid_parameter_handler)(const MSVCRT_wchar_t*, const MSVCRT_wchar_t*, const MSVCRT_wchar_t*, unsigned, uintptr_t);
typedef void (__cdecl *MSVCRT_purecall_handler)(void);
typedef void (__cdecl *MSVCRT_security_error_handler)(int, void *);
typedef struct {ULONG x80[3];} MSVCRT__LDOUBLE; /* Intel 80 bit FP format has sizeof() 12 */
struct MSVCRT_tm {
int tm_sec;
int tm_min;
int tm_hour;
int tm_mday;
int tm_mon;
int tm_year;
int tm_wday;
int tm_yday;
int tm_isdst;
};
typedef struct MSVCRT_tagLC_ID {
unsigned short wLanguage;
unsigned short wCountry;
unsigned short wCodePage;
} MSVCRT_LC_ID, *MSVCRT_LPLC_ID;
#define MSVCRT_tm tm
typedef struct {
union {
......@@ -168,7 +134,7 @@ typedef struct MSVCRT_threadlocaleinfostruct {
#endif
unsigned int lc_collate_cp;
MSVCRT_ulong lc_handle[6];
MSVCRT_LC_ID lc_id[6];
LC_ID lc_id[6];
struct {
char *locale;
MSVCRT_wchar_t *wlocale;
......@@ -409,32 +375,7 @@ extern unsigned int __cdecl _control87(unsigned int, unsigned int);
#define _RT_CRNL 252
#define _RT_BANNER 255
struct MSVCRT___timeb32 {
MSVCRT___time32_t time;
unsigned short millitm;
short timezone;
short dstflag;
};
struct MSVCRT___timeb64 {
MSVCRT___time64_t time;
unsigned short millitm;
short timezone;
short dstflag;
};
struct MSVCRT__iobuf {
char* _ptr;
int _cnt;
char* _base;
int _flag;
int _file;
int _charbuf;
int _bufsiz;
char* _tmpfname;
};
typedef struct MSVCRT__iobuf MSVCRT_FILE;
typedef struct _iobuf MSVCRT_FILE;
extern MSVCRT_FILE MSVCRT__iob[];
......@@ -477,26 +418,7 @@ struct MSVCRT__exception {
double retval;
};
struct MSVCRT__complex {
double x; /* Real part */
double y; /* Imaginary part */
};
typedef struct MSVCRT__complex _Dcomplex;
typedef struct MSVCRT__div_t {
int quot; /* quotient */
int rem; /* remainder */
} MSVCRT_div_t;
typedef struct MSVCRT__ldiv_t {
MSVCRT_long quot; /* quotient */
MSVCRT_long rem; /* remainder */
} MSVCRT_ldiv_t;
typedef struct MSVCRT__lldiv_t {
MSVCRT_longlong quot; /* quotient */
MSVCRT_longlong rem; /* remainder */
} MSVCRT_lldiv_t;
typedef struct _complex _Dcomplex;
struct MSVCRT__heapinfo {
int* _pentry;
......@@ -590,19 +512,12 @@ struct MSVCRT___JUMP_BUFFER
};
#endif /* __i386__ */
struct MSVCRT__diskfree_t {
unsigned int total_clusters;
unsigned int avail_clusters;
unsigned int sectors_per_cluster;
unsigned int bytes_per_sector;
};
struct MSVCRT__finddata32_t {
unsigned int attrib;
MSVCRT___time32_t time_create;
MSVCRT___time32_t time_access;
MSVCRT___time32_t time_write;
MSVCRT__fsize_t size;
_fsize_t size;
char name[260];
};
......@@ -620,7 +535,7 @@ struct MSVCRT__finddata64i32_t {
MSVCRT___time64_t time_create;
MSVCRT___time64_t time_access;
MSVCRT___time64_t time_write;
MSVCRT__fsize_t size;
_fsize_t size;
char name[260];
};
......@@ -638,7 +553,7 @@ struct MSVCRT__wfinddata32_t {
MSVCRT___time32_t time_create;
MSVCRT___time32_t time_access;
MSVCRT___time32_t time_write;
MSVCRT__fsize_t size;
_fsize_t size;
MSVCRT_wchar_t name[260];
};
......@@ -656,7 +571,7 @@ struct MSVCRT__wfinddata64i32_t {
MSVCRT___time64_t time_create;
MSVCRT___time64_t time_access;
MSVCRT___time64_t time_write;
MSVCRT__fsize_t size;
_fsize_t size;
MSVCRT_wchar_t name[260];
};
......@@ -681,33 +596,28 @@ struct MSVCRT___utimbuf64
MSVCRT___time64_t modtime;
};
/* for FreeBSD */
#undef st_atime
#undef st_ctime
#undef st_mtime
struct MSVCRT__stat32 {
MSVCRT__dev_t st_dev;
MSVCRT__ino_t st_ino;
_dev_t st_dev;
_ino_t st_ino;
unsigned short st_mode;
short st_nlink;
short st_uid;
short st_gid;
MSVCRT__dev_t st_rdev;
MSVCRT__off_t st_size;
_dev_t st_rdev;
_off_t st_size;
MSVCRT___time32_t st_atime;
MSVCRT___time32_t st_mtime;
MSVCRT___time32_t st_ctime;
};
struct MSVCRT__stat32i64 {
MSVCRT__dev_t st_dev;
MSVCRT__ino_t st_ino;
_dev_t st_dev;
_ino_t st_ino;
unsigned short st_mode;
short st_nlink;
short st_uid;
short st_gid;
MSVCRT__dev_t st_rdev;
_dev_t st_rdev;
__int64 DECLSPEC_ALIGN(8) st_size;
MSVCRT___time32_t st_atime;
MSVCRT___time32_t st_mtime;
......@@ -715,27 +625,27 @@ struct MSVCRT__stat32i64 {
};
struct MSVCRT__stat64i32 {
MSVCRT__dev_t st_dev;
MSVCRT__ino_t st_ino;
_dev_t st_dev;
_ino_t st_ino;
unsigned short st_mode;
short st_nlink;
short st_uid;
short st_gid;
MSVCRT__dev_t st_rdev;
MSVCRT__off_t st_size;
_dev_t st_rdev;
_off_t st_size;
MSVCRT___time64_t st_atime;
MSVCRT___time64_t st_mtime;
MSVCRT___time64_t st_ctime;
};
struct MSVCRT__stat64 {
MSVCRT__dev_t st_dev;
MSVCRT__ino_t st_ino;
_dev_t st_dev;
_ino_t st_ino;
unsigned short st_mode;
short st_nlink;
short st_uid;
short st_gid;
MSVCRT__dev_t st_rdev;
_dev_t st_rdev;
__int64 DECLSPEC_ALIGN(8) st_size;
MSVCRT___time64_t st_atime;
MSVCRT___time64_t st_mtime;
......@@ -1073,7 +983,6 @@ int __cdecl MSVCRT__fclose_nolock(MSVCRT_FILE*);
int __cdecl MSVCRT__fflush_nolock(MSVCRT_FILE*);
void __cdecl MSVCRT_terminate(void);
MSVCRT_FILE* __cdecl MSVCRT__iob_func(void);
MSVCRT_clock_t __cdecl MSVCRT_clock(void);
MSVCRT___time32_t __cdecl MSVCRT__time32(MSVCRT___time32_t*);
MSVCRT___time64_t __cdecl MSVCRT__time64(MSVCRT___time64_t*);
MSVCRT_FILE* __cdecl MSVCRT__fdopen(int, const char *);
......@@ -1151,7 +1060,7 @@ MSVCRT_wchar_t* __cdecl MSVCRT__wgetenv(const MSVCRT_wchar_t*);
void __cdecl MSVCRT__wsearchenv(const MSVCRT_wchar_t*, const MSVCRT_wchar_t*, MSVCRT_wchar_t*);
MSVCRT_intptr_t __cdecl MSVCRT__spawnvpe(int, const char*, const char* const*, const char* const*);
void __cdecl MSVCRT__invalid_parameter(const MSVCRT_wchar_t *expr, const MSVCRT_wchar_t *func,
const MSVCRT_wchar_t *file, unsigned int line, MSVCRT_uintptr_t arg);
const MSVCRT_wchar_t *file, unsigned int line, uintptr_t arg);
int __cdecl MSVCRT__toupper_l(int,MSVCRT__locale_t);
int __cdecl MSVCRT__tolower_l(int,MSVCRT__locale_t);
int __cdecl MSVCRT__towupper_l(MSVCRT_wint_t,MSVCRT__locale_t);
......
......@@ -416,7 +416,7 @@ void * CDECL Concurrency_Alloc(MSVCRT_size_t size)
}
}
TRACE("(%ld) returning %p\n", size, p->alloc.mem);
TRACE("(%Iu) returning %p\n", size, p->alloc.mem);
return p->alloc.mem;
}
......@@ -554,7 +554,7 @@ SchedulerPolicy* WINAPIV SchedulerPolicy_ctor_policies(
__ms_va_list valist;
MSVCRT_size_t i;
TRACE("(%p %ld)\n", this, n);
TRACE("(%p %Iu)\n", this, n);
SchedulerPolicy_ctor(this);
min_concurrency = this->policy_container->policies[MinConcurrency];
......
......@@ -108,7 +108,7 @@ static DWORD CALLBACK _beginthread_trampoline(LPVOID arg)
/*********************************************************************
* _beginthread (MSVCRT.@)
*/
MSVCRT_uintptr_t CDECL _beginthread(
uintptr_t CDECL _beginthread(
MSVCRT__beginthread_start_routine_t start_address, /* [in] Start address of routine that begins execution of new thread */
unsigned int stack_size, /* [in] Stack size for new thread or 0 */
void *arglist) /* [in] Argument list to be passed to new thread or NULL */
......@@ -142,13 +142,13 @@ MSVCRT_uintptr_t CDECL _beginthread(
return -1;
}
return (MSVCRT_uintptr_t)thread;
return (uintptr_t)thread;
}
/*********************************************************************
* _beginthreadex (MSVCRT.@)
*/
MSVCRT_uintptr_t CDECL _beginthreadex(
uintptr_t CDECL _beginthreadex(
void *security, /* [in] Security descriptor for new thread; must be NULL for Windows 9x applications */
unsigned int stack_size, /* [in] Stack size for new thread or 0 */
MSVCRT__beginthreadex_start_routine_t start_address, /* [in] Start address of routine that begins execution of new thread */
......@@ -159,7 +159,7 @@ MSVCRT_uintptr_t CDECL _beginthreadex(
TRACE("(%p, %d, %p, %p, %d, %p)\n", security, stack_size, start_address, arglist, initflag, thrdaddr);
/* FIXME */
return (MSVCRT_uintptr_t)CreateThread(security, stack_size,
return (uintptr_t)CreateThread(security, stack_size,
start_address, arglist,
initflag, thrdaddr);
}
......
......@@ -23,6 +23,8 @@
*/
#include <stdlib.h>
#include <time.h>
#include <sys/timeb.h>
#include "msvcrt.h"
#include "mtdll.h"
......@@ -723,7 +725,7 @@ int CDECL _wstrtime_s(MSVCRT_wchar_t* time, MSVCRT_size_t size)
/*********************************************************************
* clock (MSVCRT.@)
*/
MSVCRT_clock_t CDECL MSVCRT_clock(void)
clock_t CDECL MSVCRT_clock(void)
{
LARGE_INTEGER systime;
......@@ -765,7 +767,7 @@ double CDECL MSVCRT_difftime(MSVCRT___time32_t time1, MSVCRT___time32_t time2)
/*********************************************************************
* _ftime64 (MSVCRT.@)
*/
void CDECL MSVCRT__ftime64(struct MSVCRT___timeb64 *buf)
void CDECL MSVCRT__ftime64(struct __timeb64 *buf)
{
FILETIME ft;
ULONGLONG time;
......@@ -785,7 +787,7 @@ void CDECL MSVCRT__ftime64(struct MSVCRT___timeb64 *buf)
/*********************************************************************
* _ftime64_s (MSVCRT.@)
*/
int CDECL MSVCRT__ftime64_s(struct MSVCRT___timeb64 *buf)
int CDECL MSVCRT__ftime64_s(struct __timeb64 *buf)
{
if (!MSVCRT_CHECK_PMT( buf != NULL )) return MSVCRT_EINVAL;
MSVCRT__ftime64(buf);
......@@ -795,9 +797,9 @@ int CDECL MSVCRT__ftime64_s(struct MSVCRT___timeb64 *buf)
/*********************************************************************
* _ftime32 (MSVCRT.@)
*/
void CDECL MSVCRT__ftime32(struct MSVCRT___timeb32 *buf)
void CDECL MSVCRT__ftime32(struct __timeb32 *buf)
{
struct MSVCRT___timeb64 buf64;
struct __timeb64 buf64;
MSVCRT__ftime64( &buf64 );
buf->time = buf64.time;
......@@ -809,7 +811,7 @@ void CDECL MSVCRT__ftime32(struct MSVCRT___timeb32 *buf)
/*********************************************************************
* _ftime32_s (MSVCRT.@)
*/
int CDECL MSVCRT__ftime32_s(struct MSVCRT___timeb32 *buf)
int CDECL MSVCRT__ftime32_s(struct __timeb32 *buf)
{
if (!MSVCRT_CHECK_PMT( buf != NULL )) return MSVCRT_EINVAL;
MSVCRT__ftime32(buf);
......@@ -820,12 +822,12 @@ int CDECL MSVCRT__ftime32_s(struct MSVCRT___timeb32 *buf)
* _ftime (MSVCRT.@)
*/
#ifdef _WIN64
void CDECL MSVCRT__ftime(struct MSVCRT___timeb64 *buf)
void CDECL MSVCRT__ftime(struct __timeb64 *buf)
{
MSVCRT__ftime64( buf );
}
#else
void CDECL MSVCRT__ftime(struct MSVCRT___timeb32 *buf)
void CDECL MSVCRT__ftime(struct __timeb32 *buf)
{
MSVCRT__ftime32( buf );
}
......@@ -837,7 +839,7 @@ void CDECL MSVCRT__ftime(struct MSVCRT___timeb32 *buf)
MSVCRT___time64_t CDECL MSVCRT__time64(MSVCRT___time64_t *buf)
{
MSVCRT___time64_t curtime;
struct MSVCRT___timeb64 tb;
struct __timeb64 tb;
MSVCRT__ftime64(&tb);
......@@ -851,7 +853,7 @@ MSVCRT___time64_t CDECL MSVCRT__time64(MSVCRT___time64_t *buf)
MSVCRT___time32_t CDECL MSVCRT__time32(MSVCRT___time32_t *buf)
{
MSVCRT___time32_t curtime;
struct MSVCRT___timeb64 tb;
struct __timeb64 tb;
MSVCRT__ftime64(&tb);
......@@ -1544,13 +1546,13 @@ static MSVCRT_size_t strftime_helper(char *str, MSVCRT_size_t max, const char *f
const struct MSVCRT_tm *mstm, MSVCRT___lc_time_data *time_data, MSVCRT__locale_t loc)
{
#if _MSVCR_VER <= 90
TRACE("(%p %ld %s %p %p %p)\n", str, max, format, mstm, time_data, loc);
TRACE("(%p %Iu %s %p %p %p)\n", str, max, format, mstm, time_data, loc);
return strftime_impl(str, max, format, mstm, time_data, loc);
#else
MSVCRT_wchar_t *s, *fmt;
MSVCRT_size_t len;
TRACE("(%p %ld %s %p %p %p)\n", str, max, format, mstm, time_data, loc);
TRACE("(%p %Iu %s %p %p %p)\n", str, max, format, mstm, time_data, loc);
if (!MSVCRT_CHECK_PMT(str != NULL)) return 0;
if (!MSVCRT_CHECK_PMT(max != 0)) return 0;
......@@ -1612,7 +1614,7 @@ static MSVCRT_size_t wcsftime_helper( MSVCRT_wchar_t *str, MSVCRT_size_t max,
char *s, *fmt;
MSVCRT_size_t len;
TRACE("%p %ld %s %p %p %p\n", str, max, debugstr_w(format), mstm, time_data, loc);
TRACE("%p %Iu %s %p %p %p\n", str, max, debugstr_w(format), mstm, time_data, loc);
len = MSVCRT__wcstombs_l( NULL, format, 0, loc ) + 1;
if (!(fmt = MSVCRT_malloc( len ))) return 0;
......@@ -1629,7 +1631,7 @@ static MSVCRT_size_t wcsftime_helper( MSVCRT_wchar_t *str, MSVCRT_size_t max,
MSVCRT_free( fmt );
return len;
#else
TRACE("%p %ld %s %p %p %p\n", str, max, debugstr_w(format), mstm, time_data, loc);
TRACE("%p %Iu %s %p %p %p\n", str, max, debugstr_w(format), mstm, time_data, loc);
return strftime_impl(str, max, format, mstm, time_data, loc);
#endif
}
......
......@@ -2070,7 +2070,7 @@ MSVCRT_size_t CDECL MSVCRT_wcrtomb( char *dst, MSVCRT_wchar_t ch, MSVCRT_mbstate
/*********************************************************************
* _iswctype_l (MSVCRT.@)
*/
INT CDECL MSVCRT__iswctype_l( MSVCRT_wchar_t wc, MSVCRT_wctype_t type, MSVCRT__locale_t locale )
INT CDECL MSVCRT__iswctype_l( MSVCRT_wchar_t wc, wctype_t type, MSVCRT__locale_t locale )
{
WORD ct;
......@@ -2088,7 +2088,7 @@ INT CDECL MSVCRT__iswctype_l( MSVCRT_wchar_t wc, MSVCRT_wctype_t type, MSVCRT__l
/*********************************************************************
* iswctype (MSVCRT.@)
*/
INT CDECL MSVCRT_iswctype( MSVCRT_wchar_t wc, MSVCRT_wctype_t type )
INT CDECL MSVCRT_iswctype( MSVCRT_wchar_t wc, wctype_t type )
{
return MSVCRT__iswctype_l( wc, type, NULL );
}
......
......@@ -14,7 +14,11 @@
#include <pshpack8.h>
#ifndef _DEV_T_DEFINED
# ifdef _CRTDLL
typedef unsigned short _dev_t;
# else
typedef unsigned int _dev_t;
# endif
#define _DEV_T_DEFINED
#endif
......
......@@ -23,7 +23,11 @@
#include <corecrt.h>
#ifndef _DEV_T_DEFINED
# ifdef _CRTDLL
typedef unsigned short _dev_t;
# else
typedef unsigned int _dev_t;
# endif
#define _DEV_T_DEFINED
#endif
......
......@@ -80,7 +80,7 @@ double __cdecl _difftime64(__time64_t,__time64_t);
struct tm* __cdecl _gmtime32(const __time32_t*);
struct tm* __cdecl _gmtime64(const __time64_t*);
struct tm* __cdecl _localtime32(const __time32_t*);
errno_t __cdecl _localtime32_s(struct tm*, const __time64_t*);
errno_t __cdecl _localtime32_s(struct tm*, const __time32_t*);
struct tm* __cdecl _localtime64(const __time64_t*);
errno_t __cdecl _localtime64_s(struct tm*, const __time64_t*);
__time32_t __cdecl _mktime32(struct tm*);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment