include/msvcrt: Add explicit msvcrt_long types to replace long for 64-bit compatibility.

This commit is contained in:
Alexandre Julliard 2009-05-23 11:38:59 +02:00
parent 7e082f6608
commit 580e07e7ba
12 changed files with 72 additions and 65 deletions

View File

@ -26,10 +26,10 @@ int __cdecl _ungetch(int);
#ifdef _M_IX86
int __cdecl _inp(unsigned short);
unsigned long __cdecl _inpd(unsigned short);
__msvcrt_ulong __cdecl _inpd(unsigned short);
unsigned short __cdecl _inpw(unsigned short);
int __cdecl _outp(unsigned short, int);
unsigned long __cdecl _outpd(unsigned short, unsigned long);
__msvcrt_ulong __cdecl _outpd(unsigned short, __msvcrt_ulong);
unsigned short __cdecl _outpw(unsigned short, unsigned short);
#endif

View File

@ -44,10 +44,10 @@
typedef struct _CrtMemState
{
struct _CrtMemBlockHeader* pBlockHeader;
unsigned long lCounts[_MAX_BLOCKS];
unsigned long lSizes[_MAX_BLOCKS];
unsigned long lHighWaterCount;
unsigned long lTotalCount;
__msvcrt_ulong lCounts[_MAX_BLOCKS];
__msvcrt_ulong lSizes[_MAX_BLOCKS];
__msvcrt_ulong lHighWaterCount;
__msvcrt_ulong lTotalCount;
} _CrtMemState;
@ -60,7 +60,7 @@ typedef struct _CrtMemState
#define _CrtCheckMemory() ((int)1)
#define _CrtDbgReport(...) ((int)0)
#define _CrtDumpMemoryLeaks() ((int)0)
#define _CrtSetBreakAlloc(a) ((long)0)
#define _CrtSetBreakAlloc(a) ((__msvcrt_long)0)
#define _CrtSetDbgFlag(f) ((int)0)
#define _CrtSetDumpClient(f) ((void)0)
#define _CrtSetReportMode(t,m) ((int)0)

View File

@ -80,6 +80,13 @@
# endif
#endif
#ifndef _MSVCRT_LONG_DEFINED
#define _MSVCRT_LONG_DEFINED
/* we need 32-bit longs even on 64-bit */
typedef int __msvcrt_long;
typedef unsigned int __msvcrt_ulong;
#endif
#ifndef _INTPTR_T_DEFINED
#ifdef _WIN64
typedef __int64 intptr_t;
@ -117,7 +124,7 @@ typedef unsigned int size_t;
#endif
#ifndef _TIME32_T_DEFINED
typedef long __time32_t;
typedef __msvcrt_long __time32_t;
#define _TIME32_T_DEFINED
#endif

View File

@ -31,7 +31,7 @@ int __cdecl _chdrive(int);
char* __cdecl _getcwd(char*,int);
char* __cdecl _getdcwd(int,char*,int);
int __cdecl _getdrive(void);
unsigned long __cdecl _getdrives(void);
__msvcrt_ulong __cdecl _getdrives(void);
int __cdecl _mkdir(const char*);
int __cdecl _rmdir(const char*);

View File

@ -128,7 +128,7 @@ extern "C" {
double __cdecl _copysign (double, double);
double __cdecl _chgsign (double);
double __cdecl _scalb(double, long);
double __cdecl _scalb(double, __msvcrt_long);
double __cdecl _logb(double);
double __cdecl _nextafter(double, double);
int __cdecl _finite(double);

View File

@ -22,7 +22,7 @@
#define _A_ARCH 0x00000020
#ifndef _FSIZE_T_DEFINED
typedef unsigned long _fsize_t;
typedef __msvcrt_ulong _fsize_t;
#define _FSIZE_T_DEFINED
#endif
@ -76,7 +76,7 @@ extern "C" {
int __cdecl _access(const char*,int);
int __cdecl _chmod(const char*,int);
int __cdecl _chsize(int,long);
int __cdecl _chsize(int,__msvcrt_ulong);
int __cdecl _close(int);
int __cdecl _commit(int);
int __cdecl _creat(const char*,int);
@ -84,7 +84,7 @@ int __cdecl _dup(int);
int __cdecl _dup2(int,int);
int __cdecl _eof(int);
__int64 __cdecl _filelengthi64(int);
long __cdecl _filelength(int);
__msvcrt_long __cdecl _filelength(int);
int __cdecl _findclose(intptr_t);
intptr_t __cdecl _findfirst(const char*,struct _finddata_t*);
intptr_t __cdecl _findfirsti64(const char*, struct _finddatai64_t*);
@ -92,8 +92,8 @@ int __cdecl _findnext(intptr_t,struct _finddata_t*);
int __cdecl _findnexti64(intptr_t, struct _finddatai64_t*);
intptr_t __cdecl _get_osfhandle(int);
int __cdecl _isatty(int);
int __cdecl _locking(int,int,long);
long __cdecl _lseek(int,long,int);
int __cdecl _locking(int,int,__msvcrt_long);
__msvcrt_long __cdecl _lseek(int,__msvcrt_long,int);
__int64 __cdecl _lseeki64(int,__int64,int);
char* __cdecl _mktemp(char*);
int __cdecl _open(const char*,int,...);
@ -102,7 +102,7 @@ int __cdecl _pipe(int*,unsigned int,int);
int __cdecl _read(int,void*,unsigned int);
int __cdecl _setmode(int,int);
int __cdecl _sopen(const char*,int,int,...);
long __cdecl _tell(int);
__msvcrt_long __cdecl _tell(int);
__int64 __cdecl _telli64(int);
int __cdecl _umask(int);
int __cdecl _unlink(const char*);
@ -134,20 +134,20 @@ int __cdecl _wunlink(const wchar_t*);
static inline int access(const char* path, int mode) { return _access(path, mode); }
static inline int chmod(const char* path, int mode) { return _chmod(path, mode); }
static inline int chsize(int fd, long size) { return _chsize(fd, size); }
static inline int chsize(int fd, __msvcrt_long size) { return _chsize(fd, size); }
static inline int close(int fd) { return _close(fd); }
static inline int creat(const char* path, int mode) { return _creat(path, mode); }
static inline int dup(int od) { return _dup(od); }
static inline int dup2(int od, int nd) { return _dup2(od, nd); }
static inline int eof(int fd) { return _eof(fd); }
static inline long filelength(int fd) { return _filelength(fd); }
static inline __msvcrt_long filelength(int fd) { return _filelength(fd); }
static inline int isatty(int fd) { return _isatty(fd); }
static inline int locking(int fd, int mode, long size) { return _locking(fd, mode, size); }
static inline long lseek(int fd, long off, int where) { return _lseek(fd, off, where); }
static inline int locking(int fd, int mode, __msvcrt_long size) { return _locking(fd, mode, size); }
static inline __msvcrt_long lseek(int fd, __msvcrt_long off, int where) { return _lseek(fd, off, where); }
static inline char* mktemp(char* pat) { return _mktemp(pat); }
static inline int read(int fd, void* buf, unsigned int size) { return _read(fd, buf, size); }
static inline int setmode(int fd, int mode) { return _setmode(fd, mode); }
static inline long tell(int fd) { return _tell(fd); }
static inline __msvcrt_long tell(int fd) { return _tell(fd); }
#ifndef _UMASK_DEFINED
static inline int umask(int fd) { return _umask(fd); }
#define _UMASK_DEFINED

View File

@ -41,8 +41,8 @@
extern "C" {
#endif
unsigned long __cdecl __threadid(void);
unsigned long __cdecl __threadhandle(void);
__msvcrt_ulong __cdecl __threadid(void);
__msvcrt_ulong __cdecl __threadhandle(void);
#define _threadid (__threadid())
#ifdef __cplusplus

View File

@ -133,9 +133,9 @@ int __cdecl fputs(const char*,FILE*);
size_t __cdecl fread(void*,size_t,size_t,FILE*);
FILE* __cdecl freopen(const char*,const char*,FILE*);
int __cdecl fscanf(FILE*,const char*,...);
int __cdecl fseek(FILE*,long,int);
int __cdecl fseek(FILE*,__msvcrt_long,int);
int __cdecl fsetpos(FILE*,fpos_t*);
long __cdecl ftell(FILE*);
__msvcrt_long __cdecl ftell(FILE*);
size_t __cdecl fwrite(const void*,size_t,size_t,FILE*);
int __cdecl getc(FILE*);
int __cdecl getchar(void);

View File

@ -54,8 +54,8 @@ typedef struct _div_t {
} div_t;
typedef struct _ldiv_t {
long quot;
long rem;
__msvcrt_long quot;
__msvcrt_long rem;
} ldiv_t;
#define __max(a,b) (((a) > (b)) ? (a) : (b))
@ -116,7 +116,7 @@ extern unsigned int _fmode;
extern int* __cdecl ___mb_cur_max_func(void);
#define __mb_cur_max (*___mb_cur_max_func())
extern unsigned long* __cdecl __doserrno(void);
extern __msvcrt_ulong* __cdecl __doserrno(void);
#define _doserrno (*__doserrno())
extern int* __cdecl _errno(void);
#define errno (*_errno())
@ -142,9 +142,9 @@ char* __cdecl _fullpath(char*,const char*,size_t);
char* __cdecl _gcvt(double,int,char*);
char* __cdecl _i64toa(__int64,char*,int);
char* __cdecl _itoa(int,char*,int);
char* __cdecl _ltoa(long,char*,int);
unsigned long __cdecl _lrotl(unsigned long,int);
unsigned long __cdecl _lrotr(unsigned long,int);
char* __cdecl _ltoa(__msvcrt_long,char*,int);
__msvcrt_ulong __cdecl _lrotl(__msvcrt_ulong,int);
__msvcrt_ulong __cdecl _lrotr(__msvcrt_ulong,int);
void __cdecl _makepath(char*,const char*,const char*,const char*,const char*);
size_t __cdecl _mbstrlen(const char*);
_onexit_t __cdecl _onexit(_onexit_t);
@ -154,12 +154,12 @@ unsigned int __cdecl _rotr(unsigned int,int);
void __cdecl _searchenv(const char*,const char*,char*);
int __cdecl _set_error_mode(int);
void __cdecl _seterrormode(int);
void __cdecl _sleep(unsigned long);
void __cdecl _sleep(__msvcrt_ulong);
void __cdecl _splitpath(const char*,char*,char*,char*,char*);
long double __cdecl _strtold(const char*,char**);
void __cdecl _swab(char*,char*,int);
char* __cdecl _ui64toa(unsigned __int64,char*,int);
char* __cdecl _ultoa(unsigned long,char*,int);
char* __cdecl _ultoa(__msvcrt_ulong,char*,int);
void __cdecl _exit(int);
void __cdecl abort(void);
@ -167,16 +167,16 @@ int __cdecl abs(int);
int __cdecl atexit(void (*)(void));
double __cdecl atof(const char*);
int __cdecl atoi(const char*);
long __cdecl atol(const char*);
__msvcrt_long __cdecl atol(const char*);
void* __cdecl calloc(size_t,size_t);
#ifndef __i386__
div_t __cdecl div(int,int);
ldiv_t __cdecl ldiv(long,long);
ldiv_t __cdecl ldiv(__msvcrt_long,__msvcrt_long);
#endif
void __cdecl exit(int);
void __cdecl free(void*);
char* __cdecl getenv(const char*);
long __cdecl labs(long);
__msvcrt_long __cdecl labs(__msvcrt_long);
void* __cdecl malloc(size_t);
int __cdecl mblen(const char*,size_t);
void __cdecl perror(const char*);
@ -184,8 +184,8 @@ int __cdecl rand(void);
void* __cdecl realloc(void*,size_t);
void __cdecl srand(unsigned int);
double __cdecl strtod(const char*,char**);
long __cdecl strtol(const char*,char**,int);
unsigned long __cdecl strtoul(const char*,char**,int);
__msvcrt_long __cdecl strtol(const char*,char**,int);
__msvcrt_ulong __cdecl strtoul(const char*,char**,int);
int __cdecl system(const char*);
void* __cdecl bsearch(const void*,const void*,size_t,size_t,int (*)(const void*,const void*));
void __cdecl qsort(void*,size_t,size_t,int (*)(const void*,const void*));
@ -194,9 +194,9 @@ void __cdecl qsort(void*,size_t,size_t,int (*)(const void*,const void*)
#define _WSTDLIB_DEFINED
wchar_t* __cdecl _itow(int,wchar_t*,int);
wchar_t* __cdecl _i64tow(__int64,wchar_t*,int);
wchar_t* __cdecl _ltow(long,wchar_t*,int);
wchar_t* __cdecl _ltow(__msvcrt_long,wchar_t*,int);
wchar_t* __cdecl _ui64tow(unsigned __int64,wchar_t*,int);
wchar_t* __cdecl _ultow(unsigned long,wchar_t*,int);
wchar_t* __cdecl _ultow(__msvcrt_ulong,wchar_t*,int);
wchar_t* __cdecl _wfullpath(wchar_t*,const wchar_t*,size_t);
wchar_t* __cdecl _wgetenv(const wchar_t*);
void __cdecl _wmakepath(wchar_t*,const wchar_t*,const wchar_t*,const wchar_t*,const wchar_t*);
@ -207,14 +207,14 @@ void __cdecl _wsplitpath(const wchar_t*,wchar_t*,wchar_t*,wchar_t*,wcha
int __cdecl _wsystem(const wchar_t*);
int __cdecl _wtoi(const wchar_t*);
__int64 __cdecl _wtoi64(const wchar_t*);
long __cdecl _wtol(const wchar_t*);
__msvcrt_long __cdecl _wtol(const wchar_t*);
size_t __cdecl mbstowcs(wchar_t*,const char*,size_t);
int __cdecl mbtowc(wchar_t*,const char*,size_t);
double __cdecl wcstod(const wchar_t*,wchar_t**);
long __cdecl wcstol(const wchar_t*,wchar_t**,int);
__msvcrt_long __cdecl wcstol(const wchar_t*,wchar_t**,int);
size_t __cdecl wcstombs(char*,const wchar_t*,size_t);
unsigned long __cdecl wcstoul(const wchar_t*,wchar_t**,int);
__msvcrt_ulong __cdecl wcstoul(const wchar_t*,wchar_t**,int);
int __cdecl wctomb(char*,wchar_t);
#endif /* _WSTDLIB_DEFINED */
@ -230,11 +230,11 @@ static inline char* ecvt(double value, int ndigit, int* decpt, int* sign) { retu
static inline char* fcvt(double value, int ndigit, int* decpt, int* sign) { return _fcvt(value, ndigit, decpt, sign); }
static inline char* gcvt(double value, int ndigit, char* buf) { return _gcvt(value, ndigit, buf); }
static inline char* itoa(int value, char* str, int radix) { return _itoa(value, str, radix); }
static inline char* ltoa(long value, char* str, int radix) { return _ltoa(value, str, radix); }
static inline char* ltoa(__msvcrt_long value, char* str, int radix) { return _ltoa(value, str, radix); }
static inline _onexit_t onexit(_onexit_t func) { return _onexit(func); }
static inline int putenv(const char* str) { return _putenv(str); }
static inline void swab(char* src, char* dst, int len) { _swab(src, dst, len); }
static inline char* ultoa(unsigned long value, char* str, int radix) { return _ultoa(value, str, radix); }
static inline char* ultoa(__msvcrt_ulong value, char* str, int radix) { return _ultoa(value, str, radix); }
#ifdef __i386__
static inline div_t __wine_msvcrt_div(int num, int denom)
@ -246,13 +246,13 @@ static inline div_t __wine_msvcrt_div(int num, int denom)
ret.rem = (int)(res >> 32);
return ret;
}
static inline ldiv_t __wine_msvcrt_ldiv(long num, long denom)
static inline ldiv_t __wine_msvcrt_ldiv(__msvcrt_long num, __msvcrt_long denom)
{
extern unsigned __int64 ldiv(long,long);
extern unsigned __int64 ldiv(__msvcrt_long,__msvcrt_long);
ldiv_t ret;
unsigned __int64 res = ldiv(num,denom);
ret.quot = (long)res;
ret.rem = (long)(res >> 32);
ret.quot = (__msvcrt_long)res;
ret.rem = (__msvcrt_long)(res >> 32);
return ret;
}
#define div(num,denom) __wine_msvcrt_div(num,denom)

View File

@ -46,7 +46,7 @@ typedef int _off_t;
typedef unsigned char u_char;
typedef unsigned short u_short;
typedef unsigned int u_int;
typedef unsigned long u_long;
typedef __msvcrt_ulong u_long;
#define _BSDTYPES_DEFINED
#endif

View File

@ -25,7 +25,7 @@
#include <pshpack8.h>
#ifndef _CLOCK_T_DEFINED
typedef long clock_t;
typedef __msvcrt_long clock_t;
#define _CLOCK_T_DEFINED
#endif
@ -67,13 +67,13 @@ extern "C" {
#define _tzname (__p__tzname())
int * __cdecl __p__daylight(void);
long * __cdecl __p__dstbias(void);
long * __cdecl __p__timezone(void);
__msvcrt_long * __cdecl __p__dstbias(void);
__msvcrt_long * __cdecl __p__timezone(void);
char ** __cdecl __p__tzname(void);
#else
extern int _daylight;
extern long _dstbias;
extern long _timezone;
extern __msvcrt_long _dstbias;
extern __msvcrt_long _timezone;
extern char *_tzname;
#endif

View File

@ -45,7 +45,7 @@ typedef int mbstate_t;
#endif
#ifndef _FSIZE_T_DEFINED
typedef unsigned long _fsize_t;
typedef __msvcrt_ulong _fsize_t;
#define _FSIZE_T_DEFINED
#endif
@ -224,10 +224,10 @@ int __cdecl _wrmdir(const wchar_t*);
int __cdecl _waccess(const wchar_t*,int);
int __cdecl _wchmod(const wchar_t*,int);
int __cdecl _wcreat(const wchar_t*,int);
long __cdecl _wfindfirst(const wchar_t*,struct _wfinddata_t*);
long __cdecl _wfindfirsti64(const wchar_t*, struct _wfinddatai64_t*);
int __cdecl _wfindnext(long,struct _wfinddata_t*);
int __cdecl _wfindnexti64(long, struct _wfinddatai64_t*);
__msvcrt_long __cdecl _wfindfirst(const wchar_t*,struct _wfinddata_t*);
__msvcrt_long __cdecl _wfindfirsti64(const wchar_t*, struct _wfinddatai64_t*);
int __cdecl _wfindnext(__msvcrt_long,struct _wfinddata_t*);
int __cdecl _wfindnexti64(__msvcrt_long, struct _wfinddatai64_t*);
wchar_t* __cdecl _wmktemp(wchar_t*);
int __cdecl _wopen(const wchar_t*,int,...);
int __cdecl _wrename(const wchar_t*,const wchar_t*);
@ -314,9 +314,9 @@ int __cdecl wscanf(const wchar_t*,...);
#define _WSTDLIB_DEFINED
wchar_t* __cdecl _itow(int,wchar_t*,int);
wchar_t* __cdecl _i64tow(__int64,wchar_t*,int);
wchar_t* __cdecl _ltow(long,wchar_t*,int);
wchar_t* __cdecl _ltow(__msvcrt_long,wchar_t*,int);
wchar_t* __cdecl _ui64tow(unsigned __int64,wchar_t*,int);
wchar_t* __cdecl _ultow(unsigned long,wchar_t*,int);
wchar_t* __cdecl _ultow(__msvcrt_ulong,wchar_t*,int);
wchar_t* __cdecl _wfullpath(wchar_t*,const wchar_t*,size_t);
wchar_t* __cdecl _wgetenv(const wchar_t*);
void __cdecl _wmakepath(wchar_t*,const wchar_t*,const wchar_t*,const wchar_t*,const wchar_t*);
@ -327,14 +327,14 @@ void __cdecl _wsplitpath(const wchar_t*,wchar_t*,wchar_t*,wchar_t*,wchar_t*)
int __cdecl _wsystem(const wchar_t*);
int __cdecl _wtoi(const wchar_t*);
__int64 __cdecl _wtoi64(const wchar_t*);
long __cdecl _wtol(const wchar_t*);
__msvcrt_long __cdecl _wtol(const wchar_t*);
size_t __cdecl mbstowcs(wchar_t*,const char*,size_t);
int __cdecl mbtowc(wchar_t*,const char*,size_t);
double __cdecl wcstod(const wchar_t*,wchar_t**);
long __cdecl wcstol(const wchar_t*,wchar_t**,int);
__msvcrt_long __cdecl wcstol(const wchar_t*,wchar_t**,int);
size_t __cdecl wcstombs(char*,const wchar_t*,size_t);
unsigned long __cdecl wcstoul(const wchar_t*,wchar_t**,int);
__msvcrt_ulong __cdecl wcstoul(const wchar_t*,wchar_t**,int);
int __cdecl wctomb(char*,wchar_t);
#endif /* _WSTDLIB_DEFINED */