From 935dea2fb4c0645a3fb598949638ab6c7d09caaa Mon Sep 17 00:00:00 2001 From: Kevin Koltzau Date: Thu, 3 Nov 2005 13:17:51 +0000 Subject: [PATCH] Fix warnings and errors in 64bit. --- dlls/msvcrt/msvcrt.h | 12 +- dlls/msvcrt/process.c | 67 +++++----- dlls/msvcrt/string.c | 2 +- dlls/msvcrt/tests/headers.c | 2 + dlls/msvcrt/thread.c | 8 +- include/msvcrt/process.h | 296 ++++++++++++++++++++++---------------------- include/msvcrt/stddef.h | 30 +++++ 7 files changed, 227 insertions(+), 190 deletions(-) rewrite include/msvcrt/process.h (62%) diff --git a/dlls/msvcrt/msvcrt.h b/dlls/msvcrt/msvcrt.h index 6e0c8cb7a96..7ec6e1b339d 100644 --- a/dlls/msvcrt/msvcrt.h +++ b/dlls/msvcrt/msvcrt.h @@ -50,7 +50,15 @@ typedef unsigned short MSVCRT_wint_t; typedef unsigned short MSVCRT_wctype_t; typedef unsigned short MSVCRT__ino_t; typedef unsigned long MSVCRT__fsize_t; -typedef unsigned int MSVCRT_size_t; +#ifdef _WIN64 +typedef unsigned __int64 MSVCRT_size_t; +typedef __int64 MSVCRT_intptr_t; +typedef unsigned __int64 MSVCRT_uintptr_t; +#else +typedef unsigned int MSVCRT_size_t; +typedef int MSVCRT_intptr_t; +typedef unsigned int MSVCRT_uintptr_t; +#endif typedef unsigned int MSVCRT__dev_t; typedef int MSVCRT__off_t; typedef long MSVCRT_clock_t; @@ -584,7 +592,7 @@ int _write(int,const void*,unsigned int); int _getch(void); int _vsnwprintf(MSVCRT_wchar_t*,MSVCRT_size_t,const MSVCRT_wchar_t*,va_list); int _ismbstrail(const unsigned char* start, const unsigned char* str); -int _spawnve(int,const char*,const char* const *,const char* const *); +MSVCRT_intptr_t _spawnve(int,const char*,const char* const *,const char* const *); void _searchenv(const char*,const char*,char*); int _getdrive(void); char* _strdup(const char*); diff --git a/dlls/msvcrt/process.c b/dlls/msvcrt/process.c index c33f1e24dba..43e1084aa3d 100644 --- a/dlls/msvcrt/process.c +++ b/dlls/msvcrt/process.c @@ -35,14 +35,11 @@ WINE_DEFAULT_DEBUG_CHANNEL(msvcrt); /* INTERNAL: Spawn a child process */ -static int msvcrt_spawn(int flags, const char* exe, char* cmdline, char* env) +static MSVCRT_intptr_t msvcrt_spawn(int flags, const char* exe, char* cmdline, char* env) { STARTUPINFOA si; PROCESS_INFORMATION pi; - if (sizeof(HANDLE) != sizeof(int)) - WARN("This call is unsuitable for your architecture\n"); - if ((unsigned)flags > MSVCRT__P_DETACH) { *MSVCRT__errno() = MSVCRT_EINVAL; @@ -69,7 +66,7 @@ static int msvcrt_spawn(int flags, const char* exe, char* cmdline, char* env) GetExitCodeProcess(pi.hProcess,&pi.dwProcessId); CloseHandle(pi.hProcess); CloseHandle(pi.hThread); - return (int)pi.dwProcessId; + return pi.dwProcessId; case MSVCRT__P_DETACH: CloseHandle(pi.hProcess); pi.hProcess = 0; @@ -77,7 +74,7 @@ static int msvcrt_spawn(int flags, const char* exe, char* cmdline, char* env) case MSVCRT__P_NOWAIT: case MSVCRT__P_NOWAITO: CloseHandle(pi.hThread); - return (int)pi.hProcess; + return (MSVCRT_intptr_t)pi.hProcess; case MSVCRT__P_OVERLAY: MSVCRT__exit(0); } @@ -186,7 +183,7 @@ static char* msvcrt_valisttos(const char* arg0, va_list alist, char delim) /********************************************************************* * _cwait (MSVCRT.@) */ -int _cwait(int *status, int pid, int action) +MSVCRT_intptr_t _cwait(int *status, MSVCRT_intptr_t pid, int action) { HANDLE hPid = (HANDLE)pid; int doserrno; @@ -201,7 +198,7 @@ int _cwait(int *status, int pid, int action) GetExitCodeProcess(hPid, &stat); *status = (int)stat; } - return (int)pid; + return pid; } doserrno = GetLastError(); @@ -222,11 +219,11 @@ int _cwait(int *status, int pid, int action) * Like on Windows, this function does not handle arguments with spaces * or double-quotes. */ -int _execl(const char* name, const char* arg0, ...) +MSVCRT_intptr_t _execl(const char* name, const char* arg0, ...) { va_list ap; char * args; - int ret; + MSVCRT_intptr_t ret; va_start(ap, arg0); args = msvcrt_valisttos(arg0, ap, ' '); @@ -241,7 +238,7 @@ int _execl(const char* name, const char* arg0, ...) /********************************************************************* * _execle (MSVCRT.@) */ -int _execle(const char* name, const char* arg0, ...) +MSVCRT_intptr_t _execle(const char* name, const char* arg0, ...) { FIXME("stub\n"); return -1; @@ -253,11 +250,11 @@ int _execle(const char* name, const char* arg0, ...) * Like on Windows, this function does not handle arguments with spaces * or double-quotes. */ -int _execlp(const char* name, const char* arg0, ...) +MSVCRT_intptr_t _execlp(const char* name, const char* arg0, ...) { va_list ap; char * args; - int ret; + MSVCRT_intptr_t ret; char fullname[MAX_PATH]; _searchenv(name, "PATH", fullname); @@ -275,7 +272,7 @@ int _execlp(const char* name, const char* arg0, ...) /********************************************************************* * _execlpe (MSVCRT.@) */ -int _execlpe(const char* name, const char* arg0, ...) +MSVCRT_intptr_t _execlpe(const char* name, const char* arg0, ...) { FIXME("stub\n"); return -1; @@ -287,7 +284,7 @@ int _execlpe(const char* name, const char* arg0, ...) * Like on Windows, this function does not handle arguments with spaces * or double-quotes. */ -int _execv(const char* name, char* const* argv) +MSVCRT_intptr_t _execv(const char* name, char* const* argv) { return _spawnve(MSVCRT__P_OVERLAY, name, (const char* const*) argv, NULL); } @@ -298,7 +295,7 @@ int _execv(const char* name, char* const* argv) * Like on Windows, this function does not handle arguments with spaces * or double-quotes. */ -int _execve(const char* name, char* const* argv, const char* const* envv) +MSVCRT_intptr_t _execve(const char* name, char* const* argv, const char* const* envv) { return _spawnve(MSVCRT__P_OVERLAY, name, (const char* const*) argv, envv); } @@ -309,7 +306,7 @@ int _execve(const char* name, char* const* argv, const char* const* envv) * Like on Windows, this function does not handle arguments with spaces * or double-quotes. */ -int _execvpe(const char* name, char* const* argv, const char* const* envv) +MSVCRT_intptr_t _execvpe(const char* name, char* const* argv, const char* const* envv) { char fullname[MAX_PATH]; @@ -324,7 +321,7 @@ int _execvpe(const char* name, char* const* argv, const char* const* envv) * Like on Windows, this function does not handle arguments with spaces * or double-quotes. */ -int _execvp(const char* name, char* const* argv) +MSVCRT_intptr_t _execvp(const char* name, char* const* argv) { return _execvpe(name, argv, NULL); } @@ -335,11 +332,11 @@ int _execvp(const char* name, char* const* argv) * Like on Windows, this function does not handle arguments with spaces * or double-quotes. */ -int _spawnl(int flags, const char* name, const char* arg0, ...) +MSVCRT_intptr_t _spawnl(int flags, const char* name, const char* arg0, ...) { va_list ap; char * args; - int ret; + MSVCRT_intptr_t ret; va_start(ap, arg0); args = msvcrt_valisttos(arg0, ap, ' '); @@ -354,12 +351,12 @@ int _spawnl(int flags, const char* name, const char* arg0, ...) /********************************************************************* * _spawnle (MSVCRT.@) */ -int _spawnle(int flags, const char* name, const char* arg0, ...) +MSVCRT_intptr_t _spawnle(int flags, const char* name, const char* arg0, ...) { va_list ap; char *args, *envs = NULL; const char * const *envp; - int ret; + MSVCRT_intptr_t ret; va_start(ap, arg0); args = msvcrt_valisttos(arg0, ap, ' '); @@ -385,11 +382,11 @@ int _spawnle(int flags, const char* name, const char* arg0, ...) * Like on Windows, this function does not handle arguments with spaces * or double-quotes. */ -int _spawnlp(int flags, const char* name, const char* arg0, ...) +MSVCRT_intptr_t _spawnlp(int flags, const char* name, const char* arg0, ...) { va_list ap; char * args; - int ret; + MSVCRT_intptr_t ret; char fullname[MAX_PATH]; _searchenv(name, "PATH", fullname); @@ -407,12 +404,12 @@ int _spawnlp(int flags, const char* name, const char* arg0, ...) /********************************************************************* * _spawnlpe (MSVCRT.@) */ -int _spawnlpe(int flags, const char* name, const char* arg0, ...) +MSVCRT_intptr_t _spawnlpe(int flags, const char* name, const char* arg0, ...) { va_list ap; char *args, *envs = NULL; const char * const *envp; - int ret; + MSVCRT_intptr_t ret; char fullname[MAX_PATH]; _searchenv(name, "PATH", fullname); @@ -440,13 +437,13 @@ int _spawnlpe(int flags, const char* name, const char* arg0, ...) * Like on Windows, this function does not handle arguments with spaces * or double-quotes. */ -int _spawnve(int flags, const char* name, const char* const* argv, +MSVCRT_intptr_t _spawnve(int flags, const char* name, const char* const* argv, const char* const* envv) { char * args = msvcrt_argvtos(argv,' '); char * envs = msvcrt_argvtos(envv,0); const char *fullname = name; - int ret = -1; + MSVCRT_intptr_t ret = -1; FIXME(":not translating name %s to locate program\n",fullname); TRACE(":call (%s), params (%s), env (%s)\n",debugstr_a(name),debugstr_a(args), @@ -469,7 +466,7 @@ int _spawnve(int flags, const char* name, const char* const* argv, * Like on Windows, this function does not handle arguments with spaces * or double-quotes. */ -int _spawnv(int flags, const char* name, const char* const* argv) +MSVCRT_intptr_t _spawnv(int flags, const char* name, const char* const* argv) { return _spawnve(flags, name, argv, NULL); } @@ -480,7 +477,7 @@ int _spawnv(int flags, const char* name, const char* const* argv) * Like on Windows, this function does not handle arguments with spaces * or double-quotes. */ -int _spawnvpe(int flags, const char* name, const char* const* argv, +MSVCRT_intptr_t _spawnvpe(int flags, const char* name, const char* const* argv, const char* const* envv) { char fullname[MAX_PATH]; @@ -494,7 +491,7 @@ int _spawnvpe(int flags, const char* name, const char* const* argv, * Like on Windows, this function does not handle arguments with spaces * or double-quotes. */ -int _spawnvp(int flags, const char* name, const char* const* argv) +MSVCRT_intptr_t _spawnvp(int flags, const char* name, const char* const* argv) { return _spawnvpe(flags, name, argv, NULL); } @@ -635,15 +632,15 @@ int MSVCRT_system(const char* cmd) /********************************************************************* * _loaddll (MSVCRT.@) */ -int _loaddll(const char* dllname) +MSVCRT_intptr_t _loaddll(const char* dllname) { - return (int)LoadLibraryA(dllname); + return (MSVCRT_intptr_t)LoadLibraryA(dllname); } /********************************************************************* * _unloaddll (MSVCRT.@) */ -int _unloaddll(int dll) +int _unloaddll(MSVCRT_intptr_t dll) { if (FreeLibrary((HMODULE)dll)) return 0; @@ -658,7 +655,7 @@ int _unloaddll(int dll) /********************************************************************* * _getdllprocaddr (MSVCRT.@) */ -void *_getdllprocaddr(int dll, const char *name, int ordinal) +void *_getdllprocaddr(MSVCRT_intptr_t dll, const char *name, int ordinal) { if (name) { diff --git a/dlls/msvcrt/string.c b/dlls/msvcrt/string.c index 478742e8bf3..8797ce40080 100644 --- a/dlls/msvcrt/string.c +++ b/dlls/msvcrt/string.c @@ -57,7 +57,7 @@ char* _strdup(const char* str) /********************************************************************* * _strnset (MSVCRT.@) */ -char* _strnset(char* str, int value, unsigned int len) +char* _strnset(char* str, int value, MSVCRT_size_t len) { if (len > 0 && str) while (*str && len--) diff --git a/dlls/msvcrt/tests/headers.c b/dlls/msvcrt/tests/headers.c index f8d42773de7..15112f2b63e 100644 --- a/dlls/msvcrt/tests/headers.c +++ b/dlls/msvcrt/tests/headers.c @@ -81,6 +81,8 @@ static void test_types(void) CHECK_TYPE(_ino_t); CHECK_TYPE(_fsize_t); CHECK_TYPE(size_t); + CHECK_TYPE(intptr_t); + CHECK_TYPE(uintptr_t); CHECK_TYPE(_dev_t); CHECK_TYPE(_off_t); CHECK_TYPE(clock_t); diff --git a/dlls/msvcrt/thread.c b/dlls/msvcrt/thread.c index ffe2b0de985..262aa5753f0 100644 --- a/dlls/msvcrt/thread.c +++ b/dlls/msvcrt/thread.c @@ -70,7 +70,7 @@ static DWORD CALLBACK _beginthread_trampoline(LPVOID arg) /********************************************************************* * _beginthread (MSVCRT.@) */ -unsigned long _beginthread( +MSVCRT_uintptr_t _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 */ @@ -88,14 +88,14 @@ unsigned long _beginthread( trampoline->arglist = arglist; /* FIXME */ - return (unsigned long)CreateThread(NULL, stack_size, _beginthread_trampoline, + return (MSVCRT_uintptr_t)CreateThread(NULL, stack_size, _beginthread_trampoline, trampoline, 0, NULL); } /********************************************************************* * _beginthreadex (MSVCRT.@) */ -unsigned long _beginthreadex( +MSVCRT_uintptr_t _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 */ @@ -106,7 +106,7 @@ unsigned long _beginthreadex( TRACE("(%p, %d, %p, %p, %d, %p)\n", security, stack_size, start_address, arglist, initflag, thrdaddr); /* FIXME */ - return (unsigned long)CreateThread(security, stack_size, + return (MSVCRT_uintptr_t)CreateThread(security, stack_size, (LPTHREAD_START_ROUTINE) start_address, arglist, initflag, (LPDWORD) thrdaddr); } diff --git a/include/msvcrt/process.h b/include/msvcrt/process.h dissimilarity index 62% index 7e52d5f5bce..26107e51ca4 100644 --- a/include/msvcrt/process.h +++ b/include/msvcrt/process.h @@ -1,148 +1,148 @@ -/* - * Process definitions - * - * Derived from the mingw header written by Colin Peters. - * Modified for Wine use by Jon Griffiths and Francois Gouget. - * This file is in the public domain. - */ -#ifndef __WINE_PROCESS_H -#define __WINE_PROCESS_H -#ifndef __WINE_USE_MSVCRT -#define __WINE_USE_MSVCRT -#endif - -#ifndef _WCHAR_T_DEFINED -#define _WCHAR_T_DEFINED -#ifndef __cplusplus -typedef unsigned short wchar_t; -#endif -#endif - -/* Process creation flags */ -#define _P_WAIT 0 -#define _P_NOWAIT 1 -#define _P_OVERLAY 2 -#define _P_NOWAITO 3 -#define _P_DETACH 4 - -#define _WAIT_CHILD 0 -#define _WAIT_GRANDCHILD 1 - -#ifndef __stdcall -# ifdef __i386__ -# ifdef __GNUC__ -# define __stdcall __attribute__((__stdcall__)) -# elif defined(_MSC_VER) - /* Nothing needs to be done. __stdcall already exists */ -# else -# error You need to define __stdcall for your compiler -# endif -# else /* __i386__ */ -# define __stdcall -# endif /* __i386__ */ -#endif /* __stdcall */ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void (*_beginthread_start_routine_t)(void *); -typedef unsigned int (__stdcall *_beginthreadex_start_routine_t)(void *); - -unsigned long _beginthread(_beginthread_start_routine_t,unsigned int,void*); -unsigned long _beginthreadex(void*,unsigned int,_beginthreadex_start_routine_t,void*,unsigned int,unsigned int*); -int _cwait(int*,int,int); -void _endthread(void); -void _endthreadex(unsigned int); -int _execl(const char*,const char*,...); -int _execle(const char*,const char*,...); -int _execlp(const char*,const char*,...); -int _execlpe(const char*,const char*,...); -int _execv(const char*,char* const *); -int _execve(const char*,char* const *,const char* const *); -int _execvp(const char*,char* const *); -int _execvpe(const char*,char* const *,const char* const *); -int _getpid(void); -int _spawnl(int,const char*,const char*,...); -int _spawnle(int,const char*,const char*,...); -int _spawnlp(int,const char*,const char*,...); -int _spawnlpe(int,const char*,const char*,...); -int _spawnv(int,const char*,const char* const *); -int _spawnve(int,const char*,const char* const *,const char* const *); -int _spawnvp(int,const char*,const char* const *); -int _spawnvpe(int,const char*,const char* const *,const char* const *); - -void _c_exit(void); -void _cexit(void); -void _exit(int); -void abort(void); -void exit(int); -int system(const char*); - -#ifndef _WPROCESS_DEFINED -#define _WPROCESS_DEFINED -int _wexecl(const wchar_t*,const wchar_t*,...); -int _wexecle(const wchar_t*,const wchar_t*,...); -int _wexeclp(const wchar_t*,const wchar_t*,...); -int _wexeclpe(const wchar_t*,const wchar_t*,...); -int _wexecv(const wchar_t*,const wchar_t* const *); -int _wexecve(const wchar_t*,const wchar_t* const *,const wchar_t* const *); -int _wexecvp(const wchar_t*,const wchar_t* const *); -int _wexecvpe(const wchar_t*,const wchar_t* const *,const wchar_t* const *); -int _wspawnl(int,const wchar_t*,const wchar_t*,...); -int _wspawnle(int,const wchar_t*,const wchar_t*,...); -int _wspawnlp(int,const wchar_t*,const wchar_t*,...); -int _wspawnlpe(int,const wchar_t*,const wchar_t*,...); -int _wspawnv(int,const wchar_t*,const wchar_t* const *); -int _wspawnve(int,const wchar_t*,const wchar_t* const *,const wchar_t* const *); -int _wspawnvp(int,const wchar_t*,const wchar_t* const *); -int _wspawnvpe(int,const wchar_t*,const wchar_t* const *,const wchar_t* const *); -int _wsystem(const wchar_t*); -#endif /* _WPROCESS_DEFINED */ - -#ifdef __cplusplus -} -#endif - - -#define P_WAIT _P_WAIT -#define P_NOWAIT _P_NOWAIT -#define P_OVERLAY _P_OVERLAY -#define P_NOWAITO _P_NOWAITO -#define P_DETACH _P_DETACH - -#define WAIT_CHILD _WAIT_CHILD -#define WAIT_GRANDCHILD _WAIT_GRANDCHILD - -static inline int cwait(int *status, int pid, int action) { return _cwait(status, pid, action); } -static inline int getpid(void) { return _getpid(); } -static inline int execv(const char* name, char* const* argv) { return _execv(name, argv); } -static inline int execve(const char* name, char* const* argv, const char* const* envv) { return _execve(name, argv, envv); } -static inline int execvp(const char* name, char* const* argv) { return _execvp(name, argv); } -static inline int execvpe(const char* name, char* const* argv, const char* const* envv) { return _execvpe(name, argv, envv); } -static inline int spawnv(int flags, const char* name, const char* const* argv) { return _spawnv(flags, name, argv); } -static inline int spawnve(int flags, const char* name, const char* const* argv, const char* const* envv) { return _spawnve(flags, name, argv, envv); } -static inline int spawnvp(int flags, const char* name, const char* const* argv) { return _spawnvp(flags, name, argv); } -static inline int spawnvpe(int flags, const char* name, const char* const* argv, const char* const* envv) { return _spawnvpe(flags, name, argv, envv); } - -#if defined(__GNUC__) && (__GNUC__ < 4) -extern int execl(const char*,const char*,...) __attribute__((alias("_execl"))); -extern int execle(const char*,const char*,...) __attribute__((alias("_execle"))); -extern int execlp(const char*,const char*,...) __attribute__((alias("_execlp"))); -extern int execlpe(const char*,const char*,...) __attribute__((alias("_execlpe"))); -extern int spawnl(int,const char*,const char*,...) __attribute__((alias("_spawnl"))); -extern int spawnle(int,const char*,const char*,...) __attribute__((alias("_spawnle"))); -extern int spawnlp(int,const char*,const char*,...) __attribute__((alias("_spawnlp"))); -extern int spawnlpe(int,const char*,const char*,...) __attribute__((alias("_spawnlpe"))); -#else -#define execl _execl -#define execle _execle -#define execlp _execlp -#define execlpe _execlpe -#define spawnl _spawnl -#define spawnle _spawnle -#define spawnlp _spawnlp -#define spawnlpe _spawnlpe -#endif /* __GNUC__ */ - -#endif /* __WINE_PROCESS_H */ +/* + * Process definitions + * + * Derived from the mingw header written by Colin Peters. + * Modified for Wine use by Jon Griffiths and Francois Gouget. + * This file is in the public domain. + */ +#ifndef __WINE_PROCESS_H +#define __WINE_PROCESS_H +#ifndef __WINE_USE_MSVCRT +#define __WINE_USE_MSVCRT +#endif + +#ifndef _WCHAR_T_DEFINED +#define _WCHAR_T_DEFINED +#ifndef __cplusplus +typedef unsigned short wchar_t; +#endif +#endif + +/* Process creation flags */ +#define _P_WAIT 0 +#define _P_NOWAIT 1 +#define _P_OVERLAY 2 +#define _P_NOWAITO 3 +#define _P_DETACH 4 + +#define _WAIT_CHILD 0 +#define _WAIT_GRANDCHILD 1 + +#ifndef __stdcall +# ifdef __i386__ +# ifdef __GNUC__ +# define __stdcall __attribute__((__stdcall__)) +# elif defined(_MSC_VER) + /* Nothing needs to be done. __stdcall already exists */ +# else +# error You need to define __stdcall for your compiler +# endif +# else /* __i386__ */ +# define __stdcall +# endif /* __i386__ */ +#endif /* __stdcall */ + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void (*_beginthread_start_routine_t)(void *); +typedef unsigned int (__stdcall *_beginthreadex_start_routine_t)(void *); + +uintptr_t _beginthread(_beginthread_start_routine_t,unsigned int,void*); +uintptr_t _beginthreadex(void*,unsigned int,_beginthreadex_start_routine_t,void*,unsigned int,unsigned int*); +intptr_t _cwait(int*,intptr_t,int); +void _endthread(void); +void _endthreadex(unsigned int); +intptr_t _execl(const char*,const char*,...); +intptr_t _execle(const char*,const char*,...); +intptr_t _execlp(const char*,const char*,...); +intptr_t _execlpe(const char*,const char*,...); +intptr_t _execv(const char*,char* const *); +intptr_t _execve(const char*,char* const *,const char* const *); +intptr_t _execvp(const char*,char* const *); +intptr_t _execvpe(const char*,char* const *,const char* const *); +int _getpid(void); +intptr_t _spawnl(int,const char*,const char*,...); +intptr_t _spawnle(int,const char*,const char*,...); +intptr_t _spawnlp(int,const char*,const char*,...); +intptr_t _spawnlpe(int,const char*,const char*,...); +intptr_t _spawnv(int,const char*,const char* const *); +intptr_t _spawnve(int,const char*,const char* const *,const char* const *); +intptr_t _spawnvp(int,const char*,const char* const *); +intptr_t _spawnvpe(int,const char*,const char* const *,const char* const *); + +void _c_exit(void); +void _cexit(void); +void _exit(int); +void abort(void); +void exit(int); +int system(const char*); + +#ifndef _WPROCESS_DEFINED +#define _WPROCESS_DEFINED +intptr_t _wexecl(const wchar_t*,const wchar_t*,...); +intptr_t _wexecle(const wchar_t*,const wchar_t*,...); +intptr_t _wexeclp(const wchar_t*,const wchar_t*,...); +intptr_t _wexeclpe(const wchar_t*,const wchar_t*,...); +intptr_t _wexecv(const wchar_t*,const wchar_t* const *); +intptr_t _wexecve(const wchar_t*,const wchar_t* const *,const wchar_t* const *); +intptr_t _wexecvp(const wchar_t*,const wchar_t* const *); +intptr_t _wexecvpe(const wchar_t*,const wchar_t* const *,const wchar_t* const *); +intptr_t _wspawnl(int,const wchar_t*,const wchar_t*,...); +intptr_t _wspawnle(int,const wchar_t*,const wchar_t*,...); +intptr_t _wspawnlp(int,const wchar_t*,const wchar_t*,...); +intptr_t _wspawnlpe(int,const wchar_t*,const wchar_t*,...); +intptr_t _wspawnv(int,const wchar_t*,const wchar_t* const *); +intptr_t _wspawnve(int,const wchar_t*,const wchar_t* const *,const wchar_t* const *); +intptr_t _wspawnvp(int,const wchar_t*,const wchar_t* const *); +intptr_t _wspawnvpe(int,const wchar_t*,const wchar_t* const *,const wchar_t* const *); +int _wsystem(const wchar_t*); +#endif /* _WPROCESS_DEFINED */ + +#ifdef __cplusplus +} +#endif + + +#define P_WAIT _P_WAIT +#define P_NOWAIT _P_NOWAIT +#define P_OVERLAY _P_OVERLAY +#define P_NOWAITO _P_NOWAITO +#define P_DETACH _P_DETACH + +#define WAIT_CHILD _WAIT_CHILD +#define WAIT_GRANDCHILD _WAIT_GRANDCHILD + +static inline intptr_t cwait(int *status, intptr_t pid, int action) { return _cwait(status, pid, action); } +static inline int getpid(void) { return _getpid(); } +static inline intptr_t execv(const char* name, char* const* argv) { return _execv(name, argv); } +static inline intptr_t execve(const char* name, char* const* argv, const char* const* envv) { return _execve(name, argv, envv); } +static inline intptr_t execvp(const char* name, char* const* argv) { return _execvp(name, argv); } +static inline intptr_t execvpe(const char* name, char* const* argv, const char* const* envv) { return _execvpe(name, argv, envv); } +static inline intptr_t spawnv(int flags, const char* name, const char* const* argv) { return _spawnv(flags, name, argv); } +static inline intptr_t spawnve(int flags, const char* name, const char* const* argv, const char* const* envv) { return _spawnve(flags, name, argv, envv); } +static inline intptr_t spawnvp(int flags, const char* name, const char* const* argv) { return _spawnvp(flags, name, argv); } +static inline intptr_t spawnvpe(int flags, const char* name, const char* const* argv, const char* const* envv) { return _spawnvpe(flags, name, argv, envv); } + +#if defined(__GNUC__) && (__GNUC__ < 4) +extern intptr_t execl(const char*,const char*,...) __attribute__((alias("_execl"))); +extern intptr_t execle(const char*,const char*,...) __attribute__((alias("_execle"))); +extern intptr_t execlp(const char*,const char*,...) __attribute__((alias("_execlp"))); +extern intptr_t execlpe(const char*,const char*,...) __attribute__((alias("_execlpe"))); +extern intptr_t spawnl(int,const char*,const char*,...) __attribute__((alias("_spawnl"))); +extern intptr_t spawnle(int,const char*,const char*,...) __attribute__((alias("_spawnle"))); +extern intptr_t spawnlp(int,const char*,const char*,...) __attribute__((alias("_spawnlp"))); +extern intptr_t spawnlpe(int,const char*,const char*,...) __attribute__((alias("_spawnlpe"))); +#else +#define execl _execl +#define execle _execle +#define execlp _execlp +#define execlpe _execlpe +#define spawnl _spawnl +#define spawnle _spawnle +#define spawnlp _spawnlp +#define spawnlpe _spawnlpe +#endif /* __GNUC__ */ + +#endif /* __WINE_PROCESS_H */ diff --git a/include/msvcrt/stddef.h b/include/msvcrt/stddef.h index 6a689944c50..be1d7a57b76 100644 --- a/include/msvcrt/stddef.h +++ b/include/msvcrt/stddef.h @@ -30,13 +30,39 @@ typedef unsigned short wchar_t; #endif #endif +#ifndef _INTPTR_T_DEFINED +#ifdef _WIN64 +typedef __int64 intptr_t; +#else +typedef int intptr_t; +#endif +#define _INTPTR_T_DEFINED +#endif + +#ifndef _UINTPTR_T_DEFINED +#ifdef _WIN64 +typedef unsigned __int64 uintptr_t; +#else +typedef unsigned int uintptr_t; +#endif +#define _UINTPTR_T_DEFINED +#endif + #ifndef _PTRDIFF_T_DEFINED +#ifdef _WIN64 +typedef __int64 ptrdiff_t; +#else typedef int ptrdiff_t; +#endif #define _PTRDIFF_T_DEFINED #endif #ifndef _SIZE_T_DEFINED +#ifdef _WIN64 +typedef unsigned __int64 size_t; +#else typedef unsigned int size_t; +#endif #define _SIZE_T_DEFINED #endif @@ -48,7 +74,11 @@ typedef unsigned int size_t; #endif #endif +#ifdef _WIN64 +#define offsetof(s,m) (size_t)((ptrdiff_t)&(((s*)NULL)->m)) +#else #define offsetof(s,m) (size_t)&(((s*)NULL)->m) +#endif #ifdef __cplusplus -- 2.11.4.GIT