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
103#define RTLD_LAZY 0x001
104#define RTLD_NOW 0x002
105#define RTLD_GLOBAL 0x100
108#if !defined(HAVE_FTRUNCATE) && defined(HAVE_CHSIZE)
109#define ftruncate chsize
112#if !defined(HAVE_POPEN) && defined(HAVE__POPEN)
116#if !defined(HAVE_PCLOSE) && defined(HAVE__PCLOSE)
117#define pclose _pclose
120#if !defined(HAVE_SNPRINTF) && defined(HAVE__SNPRINTF)
121#define snprintf _snprintf
124#if !defined(HAVE_VSNPRINTF) && defined(HAVE__VSNPRINTF)
125#define vsnprintf _vsnprintf
129# define S_ISLNK(mod) (0)
134# define O_LARGEFILE 0
146#define M_PI 3.14159265358979323846
150#define M_PI_2 1.570796326794896619
154#define M_PI_4 0.785398163397448309616
160 static const unsigned __inf_bytes = 0x7f800000;
161 return *(
const float *)&__inf_bytes;
163#define INFINITY __port_infinity()
169 static const unsigned __nan_bytes = 0x7fc00000;
170 return *(
const float *)&__nan_bytes;
172#define NAN __port_nan()
178# define DECL_GLOBAL_CONSTRUCTOR(func)
179#elif defined(__GNUC__)
180# define DECL_GLOBAL_CONSTRUCTOR(func) \
181 static void func(void) __attribute__((constructor)); \
182 static void func(void)
183#elif defined(__i386__)
184# define DECL_GLOBAL_CONSTRUCTOR(func) \
185 static void __dummy_init_##func(void) { \
186 asm(".section .init,\"ax\"\n\t" \
187 "call " #func "\n\t" \
189 static void func(void)
190#elif defined(__sparc__)
191# define DECL_GLOBAL_CONSTRUCTOR(func) \
192 static void __dummy_init_##func(void) { \
193 asm("\t.section \".init\",#alloc,#execinstr\n" \
194 "\tcall " #func "\n" \
196 "\t.section \".text\",#alloc,#execinstr\n" ); } \
197 static void func(void)
198#elif defined(_M_AMD64)
199#pragma message("You must define the DECL_GLOBAL_CONSTRUCTOR macro for amd64")
201# error You must define the DECL_GLOBAL_CONSTRUCTOR macro for your platform
208#define DEFINE_REGS_ENTRYPOINT( name, fn, args, pop_args ) \
209 __ASM_GLOBAL_FUNC( name, \
210 "call " __ASM_NAME("__wine_call_from_32_regs") "\n\t" \
211 ".long " __ASM_NAME(#fn) "\n\t" \
212 ".byte " #args "," #pop_args )
221#ifndef NO_LIBWINE_PORT
223#ifndef HAVE_GETOPT_LONG
230#ifndef HAVE_STRUCT_OPTION_NAME
240extern int getopt_long (
int ___argc,
char *
const *___argv,
241 const char *__shortopts,
242 const struct option *__longopts,
int *__longind);
244 const char *__shortopts,
245 const struct option *__longopts,
int *__longind);
248#ifndef HAVE_GETPAGESIZE
252#if !defined(HAVE_ISFINITE) && !defined(isfinite)
256#if !defined(HAVE_ISINF) && !defined(isinf)
260#if !defined(HAVE_ISNAN) && !defined(isnan)
283#ifndef HAVE_SIGSETJMP
295#ifndef HAVE_STRNCASECMP
296# ifndef HAVE__STRNICMP
299# define strncasecmp _strnicmp
307#ifndef HAVE_STRCASECMP
308# ifndef HAVE__STRICMP
311# define strcasecmp _stricmp
315#if !defined(HAVE_USLEEP) && !defined(__CYGWIN__)
328extern int mkstemps(
char *
template,
int suffix_len);
344#define interlocked_cmpxchg InterlockedCompareExchange
345#define interlocked_cmpxchg_ptr InterlockedCompareExchangePointer
346#define interlocked_xchg InterlockedExchange
347#define interlocked_xchg_ptr InterlockedExchangePointer
348#define interlocked_xchg_add InterlockedExchangeAdd
350#if defined(_MSC_VER) && !defined(__clang__)
360#define ffs __builtin_ffs
365#define __WINE_NOT_PORTABLE(func) func##_is_not_portable func##_is_not_portable
367#define getopt_long __WINE_NOT_PORTABLE(getopt_long)
368#define getopt_long_only __WINE_NOT_PORTABLE(getopt_long_only)
369#define getpagesize __WINE_NOT_PORTABLE(getpagesize)
370#define lstat __WINE_NOT_PORTABLE(lstat)
371#define memcpy_unaligned __WINE_NOT_PORTABLE(memcpy_unaligned)
372#define memmove __WINE_NOT_PORTABLE(memmove)
373#define pread __WINE_NOT_PORTABLE(pread)
374#define pwrite __WINE_NOT_PORTABLE(pwrite)
375#define spawnvp __WINE_NOT_PORTABLE(spawnvp)
376#define statfs __WINE_NOT_PORTABLE(statfs)
377#define strcasecmp __WINE_NOT_PORTABLE(strcasecmp)
378#define strerror __WINE_NOT_PORTABLE(strerror)
379#define strncasecmp __WINE_NOT_PORTABLE(strncasecmp)
380#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)