stdlib.h revision 589fd26cedb2b4ebbed14f2964cad03cc8ebbca2
/*
* Standard library 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.
*/
/*
* Sun LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
* other than GPL or LGPL is available it will apply instead, Sun elects to use only
* the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
* a choice of LGPL license versions is made available with the language indicating
* that LGPLv2 or any later version may be used, or where a choice of which version
* of the LGPL is applied is otherwise unspecified.
*/
#ifndef __WINE_STDLIB_H
#define __WINE_STDLIB_H
#include <crtdefs.h>
#include <pshpack8.h>
#ifndef NULL
#ifdef __cplusplus
#define NULL 0
#else
#define NULL ((void*)0)
#endif
#endif
typedef struct
{
float f;
} _CRT_FLOAT;
typedef struct
{
double x;
} _CRT_DOUBLE;
typedef struct
{
unsigned char ld[10];
} _LDOUBLE;
#define EXIT_SUCCESS 0
#define EXIT_FAILURE -1
#define RAND_MAX 0x7FFF
#ifndef _MAX_PATH
#define _MAX_DRIVE 3
#define _MAX_FNAME 256
#define _MAX_DIR _MAX_FNAME
#define _MAX_EXT _MAX_FNAME
#define _MAX_PATH 260
#endif
typedef struct _div_t {
int quot;
int rem;
} div_t;
typedef struct _ldiv_t {
long quot;
long rem;
} ldiv_t;
#define __max(a,b) (((a) > (b)) ? (a) : (b))
#define __min(a,b) (((a) < (b)) ? (a) : (b))
#ifndef __cplusplus
#define max(a,b) (((a) > (b)) ? (a) : (b))
#define min(a,b) (((a) < (b)) ? (a) : (b))
#endif
/* _set_error_mode() constants */
#define _OUT_TO_DEFAULT 0
#define _OUT_TO_STDERR 1
#define _OUT_TO_MSGBOX 2
#define _REPORT_ERRMODE 3
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __i386__
extern unsigned int* __cdecl __p__osver(void);
#define _osver (*__p__osver())
extern unsigned int* __cdecl __p__winver(void);
#define _winver (*__p__winver())
extern unsigned int* __cdecl __p__winmajor(void);
#define _winmajor (*__p__winmajor())
extern unsigned int* __cdecl __p__winminor(void);
#define _winminor (*__p__winminor())
extern int* __cdecl __p___argc(void);
#define __argc (*__p___argc())
extern char*** __cdecl __p___argv(void);
#define __argv (*__p___argv())
#define __wargv (*__p___wargv())
extern char*** __cdecl __p__environ(void);
#define _environ (*__p__environ())
#define _wenviron (*__p__wenviron())
extern unsigned int* __cdecl __p__fmode(void);
#define _fmode (*__p__fmode())
#else /* __i386__ */
extern unsigned int _osver;
extern unsigned int _winver;
extern unsigned int _winmajor;
extern unsigned int _winminor;
extern int __argc;
extern char **__argv;
extern char **_environ;
extern unsigned int _fmode;
#endif /* __i386__ */
extern int* __cdecl ___mb_cur_max_func(void);
#define __mb_cur_max (*___mb_cur_max_func())
extern unsigned long* __cdecl __doserrno(void);
#define _doserrno (*__doserrno())
/* FIXME: We need functions to access these:
* int _sys_nerr;
* char** _sys_errlist;
*/
void __cdecl _searchenv(const char*,const char*,char*);
int __cdecl _set_error_mode(int);
void __cdecl _seterrormode(int);
void __cdecl _splitpath(const char*,char*,char*,char*,char*);
#ifndef __i386__
#endif
#ifndef _WSTDLIB_DEFINED
#define _WSTDLIB_DEFINED
#endif /* _WSTDLIB_DEFINED */
#ifdef __cplusplus
}
#endif
static inline char* ecvt(double value, int ndigit, int* decpt, int* sign) { return _ecvt(value, ndigit, decpt, sign); }
static inline char* fcvt(double value, int ndigit, int* decpt, int* sign) { return _fcvt(value, ndigit, decpt, sign); }
static inline char* ultoa(unsigned long value, char* str, int radix) { return _ultoa(value, str, radix); }
#ifdef __i386__
{
return ret;
}
{
return ret;
}
#endif
#include <poppack.h>
#endif /* __WINE_STDLIB_H */