Define __stdcall in msvcrt/process.h if windef.h hasn't been included.
[wine/wine64.git] / include / msvcrt / process.h
blobaa53d39de4b109f49f07ef84f2c9a35127132bf6
1 /*
2 * Process definitions
4 * Derived from the mingw header written by Colin Peters.
5 * Modified for Wine use by Jon Griffiths and Francois Gouget.
6 * This file is in the public domain.
7 */
8 #ifndef __WINE_PROCESS_H
9 #define __WINE_PROCESS_H
10 #define __WINE_USE_MSVCRT
12 #ifndef MSVCRT
13 # ifdef USE_MSVCRT_PREFIX
14 # define MSVCRT(x) MSVCRT_##x
15 # else
16 # define MSVCRT(x) x
17 # endif
18 #endif
20 #ifndef MSVCRT_WCHAR_T_DEFINED
21 #define MSVCRT_WCHAR_T_DEFINED
22 #ifndef __cplusplus
23 typedef unsigned short MSVCRT(wchar_t);
24 #endif
25 #endif
27 /* Process creation flags */
28 #define _P_WAIT 0
29 #define _P_NOWAIT 1
30 #define _P_OVERLAY 2
31 #define _P_NOWAITO 3
32 #define _P_DETACH 4
34 #define _WAIT_CHILD 0
35 #define _WAIT_GRANDCHILD 1
37 #ifndef __stdcall
38 # ifdef __i386__
39 # ifdef __GNUC__
40 # define __stdcall __attribute__((__stdcall__))
41 # elif defined(_MSC_VER)
42 /* Nothing needs to be done. __stdcall already exists */
43 # else
44 # error You need to define __stdcall for your compiler
45 # endif
46 # else /* __i386__ */
47 # define __stdcall
48 # endif /* __i386__ */
49 #endif /* __stdcall */
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
55 typedef void (*_beginthread_start_routine_t)(void *);
56 typedef unsigned int (__stdcall *_beginthreadex_start_routine_t)(void *);
58 unsigned long _beginthread(_beginthread_start_routine_t,unsigned int,void*);
59 unsigned long _beginthreadex(void*,unsigned int,_beginthreadex_start_routine_t,void*,unsigned int,unsigned int*);
60 int _cwait(int*,int,int);
61 void _endthread(void);
62 void _endthreadex(unsigned int);
63 int _execl(const char*,const char*,...);
64 int _execle(const char*,const char*,...);
65 int _execlp(const char*,const char*,...);
66 int _execlpe(const char*,const char*,...);
67 int _execv(const char*,char* const *);
68 int _execve(const char*,char* const *,const char* const *);
69 int _execvp(const char*,char* const *);
70 int _execvpe(const char*,char* const *,const char* const *);
71 int _getpid(void);
72 int _spawnl(int,const char*,const char*,...);
73 int _spawnle(int,const char*,const char*,...);
74 int _spawnlp(int,const char*,const char*,...);
75 int _spawnlpe(int,const char*,const char*,...);
76 int _spawnv(int,const char*,const char* const *);
77 int _spawnve(int,const char*,const char* const *,const char* const *);
78 int _spawnvp(int,const char*,const char* const *);
79 int _spawnvpe(int,const char*,const char* const *,const char* const *);
81 void MSVCRT(_c_exit)(void);
82 void MSVCRT(_cexit)(void);
83 void MSVCRT(_exit)(int);
84 void MSVCRT(abort)(void);
85 void MSVCRT(exit)(int);
86 int MSVCRT(system)(const char*);
88 #ifndef MSVCRT_WPROCESS_DEFINED
89 #define MSVCRT_WPROCESS_DEFINED
90 int _wexecl(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
91 int _wexecle(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
92 int _wexeclp(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
93 int _wexeclpe(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
94 int _wexecv(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *);
95 int _wexecve(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *,const MSVCRT(wchar_t)* const *);
96 int _wexecvp(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *);
97 int _wexecvpe(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *,const MSVCRT(wchar_t)* const *);
98 int _wspawnl(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
99 int _wspawnle(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
100 int _wspawnlp(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
101 int _wspawnlpe(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
102 int _wspawnv(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *);
103 int _wspawnve(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *,const MSVCRT(wchar_t)* const *);
104 int _wspawnvp(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *);
105 int _wspawnvpe(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *,const MSVCRT(wchar_t)* const *);
106 int _wsystem(const MSVCRT(wchar_t)*);
107 #endif /* MSVCRT_WPROCESS_DEFINED */
109 #ifdef __cplusplus
111 #endif
114 #ifndef USE_MSVCRT_PREFIX
115 #define P_WAIT _P_WAIT
116 #define P_NOWAIT _P_NOWAIT
117 #define P_OVERLAY _P_OVERLAY
118 #define P_NOWAITO _P_NOWAITO
119 #define P_DETACH _P_DETACH
121 #define WAIT_CHILD _WAIT_CHILD
122 #define WAIT_GRANDCHILD _WAIT_GRANDCHILD
124 #define cwait _cwait
125 #define getpid _getpid
126 #define execl _execl
127 #define execle _execle
128 #define execlp _execlp
129 #define execlpe _execlpe
130 #define execv _execv
131 #define execve _execve
132 #define execvp _execvp
133 #define execvpe _execvpe
134 #define spawnl _spawnl
135 #define spawnle _spawnle
136 #define spawnlp _spawnlp
137 #define spawnlpe _spawnlpe
138 #define spawnv _spawnv
139 #define spawnve _spawnve
140 #define spawnvp _spawnvp
141 #define spawnvpe _spawnvpe
142 #endif /* USE_MSVCRT_PREFIX */
144 #endif /* __WINE_PROCESS_H */