21#ifndef __WINE_WINE_PORT_H
22#define __WINE_WINE_PORT_H
24#ifndef __WINE_CONFIG_H
25# error You must include config.h to use this header
54#if !defined(_MSC_VER) && !defined(__int64)
55# if defined(__x86_64__) || defined(_WIN64)
58# define __int64 long long
62#if !defined(HAVE_MODE_T) && !defined(_MODE_T)
65#if !defined(HAVE_OFF_T) && !defined(_OFF_T)
68#if !defined(HAVE_PID_T) && !defined(_PID_T)
71#if !defined(HAVE_SIZE_T) && !defined(_SIZE_T)
74#if !defined(HAVE_SSIZE_T) && !defined(_SSIZE_T)
83# define HAVE_STRUCT_STATFS_F_BFREE
102#define RTLD_LAZY 0x001
103#define RTLD_NOW 0x002
104#define RTLD_GLOBAL 0x100
107#if !defined(HAVE_FTRUNCATE) && defined(HAVE_CHSIZE)
108#define ftruncate chsize
111#if !defined(HAVE_POPEN) && defined(HAVE__POPEN)
115#if !defined(HAVE_PCLOSE) && defined(HAVE__PCLOSE)
116#define pclose _pclose
119#if !defined(HAVE_SNPRINTF) && defined(HAVE__SNPRINTF)
120#define snprintf _snprintf
123#if !defined(HAVE_VSNPRINTF) && defined(HAVE__VSNPRINTF)
124#define vsnprintf _vsnprintf
128# define S_ISLNK(mod) (0)
133# define O_LARGEFILE 0
145#define M_PI 3.14159265358979323846
149#define M_PI_2 1.570796326794896619
153#define M_PI_4 0.785398163397448309616
159 static const unsigned __inf_bytes = 0x7f800000;
160 return *(
const float *)&__inf_bytes;
162#define INFINITY __port_infinity()
168 static const unsigned __nan_bytes = 0x7fc00000;
169 return *(
const float *)&__nan_bytes;
171#define NAN __port_nan()
177# define DECL_GLOBAL_CONSTRUCTOR(func)
178#elif defined(__GNUC__)
179# define DECL_GLOBAL_CONSTRUCTOR(func) \
180 static void func(void) __attribute__((constructor)); \
181 static void func(void)
182#elif defined(__i386__)
183# define DECL_GLOBAL_CONSTRUCTOR(func) \
184 static void __dummy_init_##func(void) { \
185 asm(".section .init,\"ax\"\n\t" \
186 "call " #func "\n\t" \
188 static void func(void)
189#elif defined(__sparc__)
190# define DECL_GLOBAL_CONSTRUCTOR(func) \
191 static void __dummy_init_##func(void) { \
192 asm("\t.section \".init\",#alloc,#execinstr\n" \
193 "\tcall " #func "\n" \
195 "\t.section \".text\",#alloc,#execinstr\n" ); } \
196 static void func(void)
197#elif defined(_M_AMD64)
198#pragma message("You must define the DECL_GLOBAL_CONSTRUCTOR macro for amd64")
200# error You must define the DECL_GLOBAL_CONSTRUCTOR macro for your platform
207#define DEFINE_REGS_ENTRYPOINT( name, fn, args, pop_args ) \
208 __ASM_GLOBAL_FUNC( name, \
209 "call " __ASM_NAME("__wine_call_from_32_regs") "\n\t" \
210 ".long " __ASM_NAME(#fn) "\n\t" \
211 ".byte " #args "," #pop_args )
220#ifndef NO_LIBWINE_PORT
222#ifndef HAVE_GETOPT_LONG
229#ifndef HAVE_STRUCT_OPTION_NAME
239extern int getopt_long (
int ___argc,
char *
const *___argv,
240 const char *__shortopts,
241 const struct option *__longopts,
int *__longind);
243 const char *__shortopts,
244 const struct option *__longopts,
int *__longind);
247#ifndef HAVE_GETPAGESIZE
251#if !defined(HAVE_ISFINITE) && !defined(isfinite)
255#if !defined(HAVE_ISINF) && !defined(isinf)
259#if !defined(HAVE_ISNAN) && !defined(isnan)
282#ifndef HAVE_SIGSETJMP
294#ifndef HAVE_STRNCASECMP
295# ifndef HAVE__STRNICMP
298# define strncasecmp _strnicmp
306#ifndef HAVE_STRCASECMP
307# ifndef HAVE__STRICMP
310# define strcasecmp _stricmp
314#if !defined(HAVE_USLEEP) && !defined(__CYGWIN__)
327extern int mkstemps(
char *
template,
int suffix_len);
343#define interlocked_cmpxchg InterlockedCompareExchange
344#define interlocked_cmpxchg_ptr InterlockedCompareExchangePointer
345#define interlocked_xchg InterlockedExchange
346#define interlocked_xchg_ptr InterlockedExchangePointer
347#define interlocked_xchg_add InterlockedExchangeAdd
349#if defined(_MSC_VER) && !defined(__clang__)
359#define ffs __builtin_ffs
364#define __WINE_NOT_PORTABLE(func) func##_is_not_portable func##_is_not_portable
366#define getopt_long __WINE_NOT_PORTABLE(getopt_long)
367#define getopt_long_only __WINE_NOT_PORTABLE(getopt_long_only)
368#define getpagesize __WINE_NOT_PORTABLE(getpagesize)
369#define lstat __WINE_NOT_PORTABLE(lstat)
370#define memcpy_unaligned __WINE_NOT_PORTABLE(memcpy_unaligned)
371#define memmove __WINE_NOT_PORTABLE(memmove)
372#define pread __WINE_NOT_PORTABLE(pread)
373#define pwrite __WINE_NOT_PORTABLE(pwrite)
374#define spawnvp __WINE_NOT_PORTABLE(spawnvp)
375#define statfs __WINE_NOT_PORTABLE(statfs)
376#define strcasecmp __WINE_NOT_PORTABLE(strcasecmp)
377#define strerror __WINE_NOT_PORTABLE(strerror)
378#define strncasecmp __WINE_NOT_PORTABLE(strncasecmp)
379#define usleep __WINE_NOT_PORTABLE(usleep)
GLint GLint GLint GLint GLint x
GLuint GLuint GLsizei count
GLenum GLuint GLenum GLsizei const GLchar * buf
unsigned char _BitScanForward(unsigned long *_Index, unsigned long _Mask)
#define memcpy(s1, s2, n)
#define memmove(s1, s2, n)
int usleep(unsigned int useconds)
int sigsetjmp(sigjmp_buf buf, int savesigs)
int mkstemps(char *template, int suffix_len)
ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset)
ssize_t pread(int fd, void *buf, size_t count, off_t offset)
const char * strerror(int err)
int getopt_long(int ___argc, char *const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind)
void siglongjmp(sigjmp_buf buf, int val)
int spawnvp(int mode, const char *cmdname, const char *const argv[])
void * memcpy_unaligned(void *dst, const void *src, size_t size)
int getopt_long_only(int ___argc, char *const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind)
int statfs(const char *name, struct statfs *info)
static float __port_infinity(void)
static float __port_nan(void)