VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/Graphics/Wine/include/msvcrt/stdlib.h@ 19711

最後變更 在這個檔案從19711是 19678,由 vboxsync 提交於 16 年 前

opengl: update wine to 1.1.21, add d3d9.dll to build list

  • 屬性 svn:eol-style 設為 native
檔案大小: 9.1 KB
 
1/*
2 * Standard library definitions
3 *
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
9/*
10 * Sun LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
11 * other than GPL or LGPL is available it will apply instead, Sun elects to use only
12 * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
13 * a choice of LGPL license versions is made available with the language indicating
14 * that LGPLv2 or any later version may be used, or where a choice of which version
15 * of the LGPL is applied is otherwise unspecified.
16 */
17
18#ifndef __WINE_STDLIB_H
19#define __WINE_STDLIB_H
20
21#include <crtdefs.h>
22
23#include <pshpack8.h>
24
25#ifndef NULL
26#ifdef __cplusplus
27#define NULL 0
28#else
29#define NULL ((void*)0)
30#endif
31#endif
32
33typedef struct
34{
35 float f;
36} _CRT_FLOAT;
37
38typedef struct
39{
40 double x;
41} _CRT_DOUBLE;
42
43typedef struct
44{
45 unsigned char ld[10];
46} _LDOUBLE;
47
48#define EXIT_SUCCESS 0
49#define EXIT_FAILURE -1
50#define RAND_MAX 0x7FFF
51
52#ifndef _MAX_PATH
53#define _MAX_DRIVE 3
54#define _MAX_FNAME 256
55#define _MAX_DIR _MAX_FNAME
56#define _MAX_EXT _MAX_FNAME
57#define _MAX_PATH 260
58#endif
59
60
61typedef struct _div_t {
62 int quot;
63 int rem;
64} div_t;
65
66typedef struct _ldiv_t {
67 long quot;
68 long rem;
69} ldiv_t;
70
71#define __max(a,b) (((a) > (b)) ? (a) : (b))
72#define __min(a,b) (((a) < (b)) ? (a) : (b))
73#ifndef __cplusplus
74#define max(a,b) (((a) > (b)) ? (a) : (b))
75#define min(a,b) (((a) < (b)) ? (a) : (b))
76#endif
77
78/* _set_error_mode() constants */
79#define _OUT_TO_DEFAULT 0
80#define _OUT_TO_STDERR 1
81#define _OUT_TO_MSGBOX 2
82#define _REPORT_ERRMODE 3
83
84
85#ifdef __cplusplus
86extern "C" {
87#endif
88
89#ifdef __i386__
90
91extern unsigned int* __cdecl __p__osver(void);
92#define _osver (*__p__osver())
93extern unsigned int* __cdecl __p__winver(void);
94#define _winver (*__p__winver())
95extern unsigned int* __cdecl __p__winmajor(void);
96#define _winmajor (*__p__winmajor())
97extern unsigned int* __cdecl __p__winminor(void);
98#define _winminor (*__p__winminor())
99extern int* __cdecl __p___argc(void);
100#define __argc (*__p___argc())
101extern char*** __cdecl __p___argv(void);
102#define __argv (*__p___argv())
103extern wchar_t*** __cdecl __p___wargv(void);
104#define __wargv (*__p___wargv())
105extern char*** __cdecl __p__environ(void);
106#define _environ (*__p__environ())
107extern wchar_t*** __cdecl __p__wenviron(void);
108#define _wenviron (*__p__wenviron())
109extern unsigned int* __cdecl __p__fmode(void);
110#define _fmode (*__p__fmode())
111
112#else /* __i386__ */
113
114extern unsigned int _osver;
115extern unsigned int _winver;
116extern unsigned int _winmajor;
117extern unsigned int _winminor;
118extern int __argc;
119extern char **__argv;
120extern wchar_t **__wargv;
121extern char **_environ;
122extern wchar_t **_wenviron;
123extern unsigned int _fmode;
124
125#endif /* __i386__ */
126
127extern int* __cdecl ___mb_cur_max_func(void);
128#define __mb_cur_max (*___mb_cur_max_func())
129extern unsigned long* __cdecl __doserrno(void);
130#define _doserrno (*__doserrno())
131extern int* __cdecl _errno(void);
132#define errno (*_errno())
133
134/* FIXME: We need functions to access these:
135 * int _sys_nerr;
136 * char** _sys_errlist;
137 */
138
139
140typedef int (__cdecl *_onexit_t)(void);
141
142
143int __cdecl _atodbl(_CRT_DOUBLE*,char*);
144int __cdecl _atoflt(_CRT_FLOAT*,char*);
145__int64 __cdecl _atoi64(const char*);
146long double __cdecl _atold(const char*);
147int __cdecl _atoldbl(_LDOUBLE*,char*);
148void __cdecl _beep(unsigned int,unsigned int);
149char* __cdecl _ecvt(double,int,int*,int*);
150char* __cdecl _fcvt(double,int,int*,int*);
151char* __cdecl _fullpath(char*,const char*,size_t);
152char* __cdecl _gcvt(double,int,char*);
153char* __cdecl _i64toa(__int64,char*,int);
154char* __cdecl _itoa(int,char*,int);
155char* __cdecl _ltoa(long,char*,int);
156unsigned long __cdecl _lrotl(unsigned long,int);
157unsigned long __cdecl _lrotr(unsigned long,int);
158void __cdecl _makepath(char*,const char*,const char*,const char*,const char*);
159size_t __cdecl _mbstrlen(const char*);
160_onexit_t __cdecl _onexit(_onexit_t);
161int __cdecl _putenv(const char*);
162unsigned int __cdecl _rotl(unsigned int,int);
163unsigned int __cdecl _rotr(unsigned int,int);
164void __cdecl _searchenv(const char*,const char*,char*);
165int __cdecl _set_error_mode(int);
166void __cdecl _seterrormode(int);
167void __cdecl _sleep(unsigned long);
168void __cdecl _splitpath(const char*,char*,char*,char*,char*);
169long double __cdecl _strtold(const char*,char**);
170void __cdecl _swab(char*,char*,int);
171char* __cdecl _ui64toa(unsigned __int64,char*,int);
172char* __cdecl _ultoa(unsigned long,char*,int);
173
174void __cdecl _exit(int);
175void __cdecl abort(void);
176int __cdecl abs(int);
177int __cdecl atexit(void (*)(void));
178double __cdecl atof(const char*);
179int __cdecl atoi(const char*);
180long __cdecl atol(const char*);
181void* __cdecl calloc(size_t,size_t);
182#ifndef __i386__
183div_t __cdecl div(int,int);
184ldiv_t __cdecl ldiv(long,long);
185#endif
186void __cdecl exit(int);
187void __cdecl free(void*);
188char* __cdecl getenv(const char*);
189long __cdecl labs(long);
190void* __cdecl malloc(size_t);
191int __cdecl mblen(const char*,size_t);
192void __cdecl perror(const char*);
193int __cdecl rand(void);
194void* __cdecl realloc(void*,size_t);
195void __cdecl srand(unsigned int);
196double __cdecl strtod(const char*,char**);
197long __cdecl strtol(const char*,char**,int);
198unsigned long __cdecl strtoul(const char*,char**,int);
199int __cdecl system(const char*);
200void* __cdecl bsearch(const void*,const void*,size_t,size_t,int (*)(const void*,const void*));
201void __cdecl qsort(void*,size_t,size_t,int (*)(const void*,const void*));
202
203#ifndef _WSTDLIB_DEFINED
204#define _WSTDLIB_DEFINED
205wchar_t* __cdecl _itow(int,wchar_t*,int);
206wchar_t* __cdecl _i64tow(__int64,wchar_t*,int);
207wchar_t* __cdecl _ltow(long,wchar_t*,int);
208wchar_t* __cdecl _ui64tow(unsigned __int64,wchar_t*,int);
209wchar_t* __cdecl _ultow(unsigned long,wchar_t*,int);
210wchar_t* __cdecl _wfullpath(wchar_t*,const wchar_t*,size_t);
211wchar_t* __cdecl _wgetenv(const wchar_t*);
212void __cdecl _wmakepath(wchar_t*,const wchar_t*,const wchar_t*,const wchar_t*,const wchar_t*);
213void __cdecl _wperror(const wchar_t*);
214int __cdecl _wputenv(const wchar_t*);
215void __cdecl _wsearchenv(const wchar_t*,const wchar_t*,wchar_t*);
216void __cdecl _wsplitpath(const wchar_t*,wchar_t*,wchar_t*,wchar_t*,wchar_t*);
217int __cdecl _wsystem(const wchar_t*);
218int __cdecl _wtoi(const wchar_t*);
219__int64 __cdecl _wtoi64(const wchar_t*);
220long __cdecl _wtol(const wchar_t*);
221
222size_t __cdecl mbstowcs(wchar_t*,const char*,size_t);
223int __cdecl mbtowc(wchar_t*,const char*,size_t);
224double __cdecl wcstod(const wchar_t*,wchar_t**);
225long __cdecl wcstol(const wchar_t*,wchar_t**,int);
226size_t __cdecl wcstombs(char*,const wchar_t*,size_t);
227unsigned long __cdecl wcstoul(const wchar_t*,wchar_t**,int);
228int __cdecl wctomb(char*,wchar_t);
229#endif /* _WSTDLIB_DEFINED */
230
231#ifdef __cplusplus
232}
233#endif
234
235
236#define environ _environ
237#define onexit_t _onexit_t
238
239static inline char* ecvt(double value, int ndigit, int* decpt, int* sign) { return _ecvt(value, ndigit, decpt, sign); }
240static inline char* fcvt(double value, int ndigit, int* decpt, int* sign) { return _fcvt(value, ndigit, decpt, sign); }
241static inline char* gcvt(double value, int ndigit, char* buf) { return _gcvt(value, ndigit, buf); }
242static inline char* itoa(int value, char* str, int radix) { return _itoa(value, str, radix); }
243static inline char* ltoa(long value, char* str, int radix) { return _ltoa(value, str, radix); }
244static inline _onexit_t onexit(_onexit_t func) { return _onexit(func); }
245static inline int putenv(const char* str) { return _putenv(str); }
246static inline void swab(char* src, char* dst, int len) { _swab(src, dst, len); }
247static inline char* ultoa(unsigned long value, char* str, int radix) { return _ultoa(value, str, radix); }
248
249#ifdef __i386__
250static inline div_t __wine_msvcrt_div(int num, int denom)
251{
252 extern unsigned __int64 div(int,int);
253 div_t ret;
254 unsigned __int64 res = div(num,denom);
255 ret.quot = (int)res;
256 ret.rem = (int)(res >> 32);
257 return ret;
258}
259static inline ldiv_t __wine_msvcrt_ldiv(long num, long denom)
260{
261 extern unsigned __int64 ldiv(long,long);
262 ldiv_t ret;
263 unsigned __int64 res = ldiv(num,denom);
264 ret.quot = (long)res;
265 ret.rem = (long)(res >> 32);
266 return ret;
267}
268#define div(num,denom) __wine_msvcrt_div(num,denom)
269#define ldiv(num,denom) __wine_msvcrt_ldiv(num,denom)
270#endif
271
272#include <poppack.h>
273
274#endif /* __WINE_STDLIB_H */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette