mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 03:15:43 +00:00
Added a newly generated config.h
updated ERR to report as DPRINT1 Added the WINE exception handler header. Cleanup of the porting headers....... Let me know if something breaks. I did a rebuild and it was fine for me svn path=/trunk/; revision=7218
This commit is contained in:
parent
b110169179
commit
9fb814dc9e
5 changed files with 694 additions and 43 deletions
|
@ -39,6 +39,12 @@
|
|||
/* Define to 1 if you have the <audio/soundlib.h> header file. */
|
||||
/* #undef HAVE_AUDIO_SOUNDLIB_H */
|
||||
|
||||
/* Define to 1 if you have the <capi20.h> header file. */
|
||||
/* #undef HAVE_CAPI20_H */
|
||||
|
||||
/* Define if you have capi4linux libs and headers */
|
||||
/* #undef HAVE_CAPI4LINUX */
|
||||
|
||||
/* Define to 1 if you have the `chsize' function. */
|
||||
#define HAVE_CHSIZE 1
|
||||
|
||||
|
@ -75,6 +81,12 @@
|
|||
/* Define to 1 if you have the <float.h> header file. */
|
||||
#define HAVE_FLOAT_H 1
|
||||
|
||||
/* Define to 1 if you have the <fontconfig/fontconfig.h> header file. */
|
||||
/* #undef HAVE_FONTCONFIG_FONTCONFIG_H */
|
||||
|
||||
/* Define to 1 if you have the 'fork' function. */
|
||||
/* #undef HAVE_FORK */
|
||||
|
||||
/* Define to 1 if you have the `fpclass' function. */
|
||||
#define HAVE_FPCLASS 1
|
||||
|
||||
|
@ -108,6 +120,9 @@
|
|||
/* Define to 1 if you have the <freetype/tttables.h> header file. */
|
||||
/* #undef HAVE_FREETYPE_TTTABLES_H */
|
||||
|
||||
/* Define to 1 if you have the <ft2build.h> header file. */
|
||||
/* #undef HAVE_FT2BUILD_H */
|
||||
|
||||
/* Define to 1 if you have the `ftruncate' function. */
|
||||
/* #undef HAVE_FTRUNCATE */
|
||||
|
||||
|
@ -147,6 +162,9 @@
|
|||
/* Define to 1 if you have the `getservbyport' function. */
|
||||
/* #undef HAVE_GETSERVBYPORT */
|
||||
|
||||
/* Define to 1 if you have the `gettid' function. */
|
||||
/* #undef HAVE_GETTID */
|
||||
|
||||
/* Define to 1 if you have the `gettimeofday' function. */
|
||||
/* #undef HAVE_GETTIMEOFDAY */
|
||||
|
||||
|
@ -225,9 +243,6 @@
|
|||
/* Define to 1 if you have the `m' library (-lm). */
|
||||
#define HAVE_LIBM 1
|
||||
|
||||
/* Define to 1 if you have the `mmap' library (-lmmap). */
|
||||
/* #undef HAVE_LIBMMAP */
|
||||
|
||||
/* Define if you have the ncurses library (-lncurses) */
|
||||
/* #undef HAVE_LIBNCURSES */
|
||||
|
||||
|
@ -237,6 +252,9 @@
|
|||
/* Define to 1 if you have the `ossaudio' library (-lossaudio). */
|
||||
/* #undef HAVE_LIBOSSAUDIO */
|
||||
|
||||
/* Define to 1 if you have the `poll' library (-lpoll). */
|
||||
/* #undef HAVE_LIBPOLL */
|
||||
|
||||
/* Define to 1 if you have the `resolv' library (-lresolv). */
|
||||
/* #undef HAVE_LIBRESOLV */
|
||||
|
||||
|
@ -252,6 +270,9 @@
|
|||
/* Define to 1 if you have the `xpg4' library (-lxpg4). */
|
||||
/* #undef HAVE_LIBXPG4 */
|
||||
|
||||
/* Define if you have the Xrandr library */
|
||||
/* #undef HAVE_LIBXRANDR */
|
||||
|
||||
/* Define if you have the X Shape extension */
|
||||
/* #undef HAVE_LIBXSHAPE */
|
||||
|
||||
|
@ -273,6 +294,9 @@
|
|||
/* Define if <linux/joystick.h> defines the Linux 2.2 joystick API */
|
||||
/* #undef HAVE_LINUX_22_JOYSTICK_API */
|
||||
|
||||
/* Define to 1 if you have the <linux/capi.h> header file. */
|
||||
/* #undef HAVE_LINUX_CAPI_H */
|
||||
|
||||
/* Define to 1 if you have the <linux/cdrom.h> header file. */
|
||||
/* #undef HAVE_LINUX_CDROM_H */
|
||||
|
||||
|
@ -363,9 +387,6 @@
|
|||
/* Define to 1 if you have the <net/route.h> header file. */
|
||||
/* #undef HAVE_NET_ROUTE_H */
|
||||
|
||||
/* Define to use glibc NPTL threading support. */
|
||||
/* #undef HAVE_NPTL */
|
||||
|
||||
/* Define to 1 if the system has the type `off_t'. */
|
||||
#define HAVE_OFF_T 1
|
||||
|
||||
|
@ -387,6 +408,9 @@
|
|||
/* Define to 1 if the system has the type `pid_t'. */
|
||||
#define HAVE_PID_T 1
|
||||
|
||||
/* Define to 1 if you have the `pipe' function. */
|
||||
/* #undef HAVE_PIPE */
|
||||
|
||||
/* Define to 1 if you have the `popen' function. */
|
||||
#define HAVE_POPEN 1
|
||||
|
||||
|
@ -396,20 +420,20 @@
|
|||
/* Define to 1 if you have the `pread' function. */
|
||||
/* #undef HAVE_PREAD */
|
||||
|
||||
/* Define to 1 if you have the `pthread_getspecific' function. */
|
||||
/* #undef HAVE_PTHREAD_GETSPECIFIC */
|
||||
/* Define to 1 if you have the <process.h> header file. */
|
||||
#define HAVE_PROCESS_H 1
|
||||
|
||||
/* Define to 1 if you have the `pthread_key_create' function. */
|
||||
/* #undef HAVE_PTHREAD_KEY_CREATE */
|
||||
/* Define to 1 if you have the `pthread_getattr_np' function. */
|
||||
/* #undef HAVE_PTHREAD_GETATTR_NP */
|
||||
|
||||
/* Define to 1 if you have the `pthread_mutex_lock' function. */
|
||||
/* #undef HAVE_PTHREAD_MUTEX_LOCK */
|
||||
/* Define to 1 if you have the <pthread.h> header file. */
|
||||
/* #undef HAVE_PTHREAD_H */
|
||||
|
||||
/* Define to 1 if you have the `pthread_mutex_unlock' function. */
|
||||
/* #undef HAVE_PTHREAD_MUTEX_UNLOCK */
|
||||
/* Define to 1 if the system has the type `pthread_rwlockattr_t'. */
|
||||
/* #undef HAVE_PTHREAD_RWLOCKATTR_T */
|
||||
|
||||
/* Define to 1 if you have the `pthread_setspecific' function. */
|
||||
/* #undef HAVE_PTHREAD_SETSPECIFIC */
|
||||
/* Define to 1 if the system has the type `pthread_rwlock_t'. */
|
||||
/* #undef HAVE_PTHREAD_RWLOCK_T */
|
||||
|
||||
/* Define to 1 if you have the <pty.h> header file. */
|
||||
/* #undef HAVE_PTY_H */
|
||||
|
@ -438,6 +462,12 @@
|
|||
/* Define to 1 if you have the <sched.h> header file. */
|
||||
/* #undef HAVE_SCHED_H */
|
||||
|
||||
/* Define to 1 if you have the <scsi/scsi.h> header file. */
|
||||
/* #undef HAVE_SCSI_SCSI_H */
|
||||
|
||||
/* Define to 1 if you have the <scsi/scsi_ioctl.h> header file. */
|
||||
/* #undef HAVE_SCSI_SCSI_IOCTL_H */
|
||||
|
||||
/* Define to 1 if you have the <scsi/sg.h> header file. */
|
||||
/* #undef HAVE_SCSI_SG_H */
|
||||
|
||||
|
@ -456,6 +486,9 @@
|
|||
/* Define to 1 if `si_fd' is member of `siginfo_t'. */
|
||||
/* #undef HAVE_SIGINFO_T_SI_FD */
|
||||
|
||||
/* Define to 1 if you have the sigsetjmp (and siglongjmp) function */
|
||||
/* #undef HAVE_SIGSETJMP */
|
||||
|
||||
/* Define to 1 if the system has the type `size_t'. */
|
||||
#define HAVE_SIZE_T 1
|
||||
|
||||
|
@ -468,6 +501,9 @@
|
|||
/* Define to 1 if you have the <soundcard.h> header file. */
|
||||
/* #undef HAVE_SOUNDCARD_H */
|
||||
|
||||
/* Define to 1 if you have the `spawnvp' function. */
|
||||
#define HAVE_SPAWNVP 1
|
||||
|
||||
/* Define to 1 if the system has the type `ssize_t'. */
|
||||
/* #undef HAVE_SSIZE_T */
|
||||
|
||||
|
@ -513,6 +549,9 @@
|
|||
/* Define to 1 if `f_bfree' is member of `struct statfs'. */
|
||||
/* #undef HAVE_STRUCT_STATFS_F_BFREE */
|
||||
|
||||
/* Define to 1 if `st_blocks' is member of `struct stat'. */
|
||||
/* #undef HAVE_STRUCT_STAT_ST_BLOCKS */
|
||||
|
||||
/* Define to 1 if you have the <syscall.h> header file. */
|
||||
/* #undef HAVE_SYSCALL_H */
|
||||
|
||||
|
@ -672,6 +711,9 @@
|
|||
/* Define to 1 if you have the `vsnprintf' function. */
|
||||
#define HAVE_VSNPRINTF 1
|
||||
|
||||
/* Define to 1 if you have the `wait' function. */
|
||||
/* #undef HAVE_WAIT */
|
||||
|
||||
/* Define to 1 if you have the `wait4' function. */
|
||||
/* #undef HAVE_WAIT4 */
|
||||
|
||||
|
@ -687,6 +729,9 @@
|
|||
/* Define to 1 if you have the <X11/extensions/xf86vmode.h> header file. */
|
||||
/* #undef HAVE_X11_EXTENSIONS_XF86VMODE_H */
|
||||
|
||||
/* Define to 1 if you have the <X11/extensions/Xrandr.h> header file. */
|
||||
/* #undef HAVE_X11_EXTENSIONS_XRANDR_H */
|
||||
|
||||
/* Define to 1 if you have the <X11/extensions/Xrender.h> header file. */
|
||||
/* #undef HAVE_X11_EXTENSIONS_XRENDER_H */
|
||||
|
||||
|
@ -754,13 +799,13 @@
|
|||
#define PACKAGE_NAME "Wine"
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#define PACKAGE_STRING "Wine 20030709"
|
||||
#define PACKAGE_STRING "Wine 20031118"
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#define PACKAGE_TARNAME "wine"
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#define PACKAGE_VERSION "20030709"
|
||||
#define PACKAGE_VERSION "20031118"
|
||||
|
||||
/* The size of a `long long', as computed by sizeof. */
|
||||
#define SIZEOF_LONG_LONG 8
|
||||
|
@ -771,6 +816,12 @@
|
|||
/* Define to the soname of the libcups library. */
|
||||
/* #undef SONAME_LIBCUPS */
|
||||
|
||||
/* Define to the soname of the libcurses library. */
|
||||
/* #undef SONAME_LIBCURSES */
|
||||
|
||||
/* Define to the soname of the libfontconfig library. */
|
||||
/* #undef SONAME_LIBFONTCONFIG */
|
||||
|
||||
/* Define to the soname of the libfreetype library. */
|
||||
/* #undef SONAME_LIBFREETYPE */
|
||||
|
||||
|
@ -780,6 +831,9 @@
|
|||
/* Define to the soname of the libjack library. */
|
||||
/* #undef SONAME_LIBJACK */
|
||||
|
||||
/* Define to the soname of the libncurses library. */
|
||||
/* #undef SONAME_LIBNCURSES */
|
||||
|
||||
/* Define to the soname of the libssl library. */
|
||||
/* #undef SONAME_LIBSSL */
|
||||
|
||||
|
|
|
@ -65,8 +65,8 @@ inline static const char *debugres_w( const WCHAR *s ) { return wine_dbgstr_wn(
|
|||
#define FIXME_ON(ch) 1
|
||||
#endif
|
||||
|
||||
#define ERR DPRINT
|
||||
#define ERR_(ch) DPRINT
|
||||
#define ERR DPRINT1
|
||||
#define ERR_(ch) DPRINT1
|
||||
#ifdef NDEBUG
|
||||
#define ERR_ON(ch) 0
|
||||
#else
|
||||
|
|
203
reactos/include/wine/exception.h
Normal file
203
reactos/include/wine/exception.h
Normal file
|
@ -0,0 +1,203 @@
|
|||
/*
|
||||
* Wine exception handling
|
||||
*
|
||||
* Copyright (c) 1999 Alexandre Julliard
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef __WINE_WINE_EXCEPTION_H
|
||||
#define __WINE_WINE_EXCEPTION_H
|
||||
|
||||
#include <setjmp.h>
|
||||
#include <windef.h>
|
||||
#include <excpt.h>
|
||||
|
||||
/* The following definitions allow using exceptions in Wine and Winelib code
|
||||
*
|
||||
* They should be used like this:
|
||||
*
|
||||
* __TRY
|
||||
* {
|
||||
* do some stuff that can raise an exception
|
||||
* }
|
||||
* __EXCEPT(filter_func,param)
|
||||
* {
|
||||
* handle the exception here
|
||||
* }
|
||||
* __ENDTRY
|
||||
*
|
||||
* or
|
||||
*
|
||||
* __TRY
|
||||
* {
|
||||
* do some stuff that can raise an exception
|
||||
* }
|
||||
* __FINALLY(finally_func,param)
|
||||
*
|
||||
* The filter_func must be defined with the WINE_EXCEPTION_FILTER
|
||||
* macro, and return one of the EXCEPTION_* code; it can use
|
||||
* GetExceptionInformation and GetExceptionCode to retrieve the
|
||||
* exception info.
|
||||
*
|
||||
* The finally_func must be defined with the WINE_FINALLY_FUNC macro.
|
||||
*
|
||||
* Warning: inside a __TRY or __EXCEPT block, 'break' or 'continue' statements
|
||||
* break out of the current block. You cannot use 'return', 'goto'
|
||||
* or 'longjmp' to leave a __TRY block, as this will surely crash.
|
||||
* You can use them to leave a __EXCEPT block though.
|
||||
*
|
||||
* -- AJ
|
||||
*/
|
||||
|
||||
/* Define this if you want to use your compiler built-in __try/__except support.
|
||||
* This is only useful when compiling to a native Windows binary, as the built-in
|
||||
* compiler exceptions will most certainly not work under Winelib.
|
||||
*/
|
||||
#ifdef USE_COMPILER_EXCEPTIONS
|
||||
|
||||
#define __TRY __try
|
||||
#define __EXCEPT(func) __except((func)(GetExceptionInformation()))
|
||||
#define __FINALLY(func) __finally { (func)(!AbnormalTermination()); }
|
||||
#define __ENDTRY /*nothing*/
|
||||
|
||||
#else /* USE_COMPILER_EXCEPTIONS */
|
||||
|
||||
#define __TRY \
|
||||
do { __WINE_FRAME __f; \
|
||||
int __first = 1; \
|
||||
for (;;) if (!__first) \
|
||||
{ \
|
||||
do {
|
||||
|
||||
#define __EXCEPT(func) \
|
||||
} while(0); \
|
||||
__wine_pop_frame( &__f.frame ); \
|
||||
break; \
|
||||
} else { \
|
||||
__f.frame.Handler = __wine_exception_handler; \
|
||||
__f.u.filter = (func); \
|
||||
__wine_push_frame( &__f.frame ); \
|
||||
if (sigsetjmp( __f.jmp, 1 )) { \
|
||||
const __WINE_FRAME * const __eptr WINE_UNUSED = &__f; \
|
||||
do {
|
||||
|
||||
#define __ENDTRY \
|
||||
} while (0); \
|
||||
break; \
|
||||
} \
|
||||
__first = 0; \
|
||||
} \
|
||||
} while (0);
|
||||
|
||||
#define __FINALLY(func) \
|
||||
} while(0); \
|
||||
__wine_pop_frame( &__f.frame ); \
|
||||
(func)(1); \
|
||||
break; \
|
||||
} else { \
|
||||
__f.frame.Handler = __wine_finally_handler; \
|
||||
__f.u.finally_func = (func); \
|
||||
__wine_push_frame( &__f.frame ); \
|
||||
__first = 0; \
|
||||
} \
|
||||
} while (0);
|
||||
|
||||
|
||||
typedef DWORD (CALLBACK *__WINE_FILTER)(PEXCEPTION_POINTERS);
|
||||
typedef void (CALLBACK *__WINE_FINALLY)(BOOL);
|
||||
|
||||
#define WINE_EXCEPTION_FILTER(func) DWORD WINAPI func( EXCEPTION_POINTERS *__eptr )
|
||||
#define WINE_FINALLY_FUNC(func) void WINAPI func( BOOL __normal )
|
||||
|
||||
#define GetExceptionInformation() (__eptr)
|
||||
#define GetExceptionCode() (__eptr->ExceptionRecord->ExceptionCode)
|
||||
|
||||
#if defined(AbnormalTermination) && defined(__REACTOS__)
|
||||
#undef AbnormalTermination
|
||||
#endif
|
||||
|
||||
#define AbnormalTermination() (!__normal)
|
||||
|
||||
typedef struct __tagWINE_FRAME
|
||||
{
|
||||
EXCEPTION_REGISTRATION_RECORD frame;
|
||||
union
|
||||
{
|
||||
/* exception data */
|
||||
__WINE_FILTER filter;
|
||||
/* finally data */
|
||||
__WINE_FINALLY finally_func;
|
||||
} u;
|
||||
sigjmp_buf jmp;
|
||||
/* hack to make GetExceptionCode() work in handler */
|
||||
DWORD ExceptionCode;
|
||||
const struct __tagWINE_FRAME *ExceptionRecord;
|
||||
} __WINE_FRAME;
|
||||
|
||||
extern DWORD __wine_exception_handler( PEXCEPTION_RECORD record, EXCEPTION_REGISTRATION_RECORD *frame,
|
||||
CONTEXT *context, EXCEPTION_REGISTRATION_RECORD **pdispatcher );
|
||||
extern DWORD __wine_finally_handler( PEXCEPTION_RECORD record, EXCEPTION_REGISTRATION_RECORD *frame,
|
||||
CONTEXT *context, EXCEPTION_REGISTRATION_RECORD **pdispatcher );
|
||||
|
||||
#endif /* USE_COMPILER_EXCEPTIONS */
|
||||
|
||||
static inline EXCEPTION_REGISTRATION_RECORD *__wine_push_frame( EXCEPTION_REGISTRATION_RECORD *frame )
|
||||
{
|
||||
#if defined(__GNUC__) && defined(__i386__)
|
||||
EXCEPTION_REGISTRATION_RECORD *prev;
|
||||
__asm__ __volatile__(".byte 0x64\n\tmovl (0),%0"
|
||||
"\n\tmovl %0,(%1)"
|
||||
"\n\t.byte 0x64\n\tmovl %1,(0)"
|
||||
: "=&r" (prev) : "r" (frame) : "memory" );
|
||||
return prev;
|
||||
#else
|
||||
NT_TIB *teb = (NT_TIB *)NtCurrentTeb();
|
||||
frame->Prev = (void *)teb->ExceptionList;
|
||||
teb->ExceptionList = (void *)frame;
|
||||
return frame->Prev;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline EXCEPTION_REGISTRATION_RECORD *__wine_pop_frame( EXCEPTION_REGISTRATION_RECORD *frame )
|
||||
{
|
||||
#if defined(__GNUC__) && defined(__i386__)
|
||||
__asm__ __volatile__(".byte 0x64\n\tmovl %0,(0)"
|
||||
//: : "r" (frame->Prev) : "memory" );
|
||||
//return frame->Prev;
|
||||
: : "r" (frame->prev) : "memory" );
|
||||
return frame->prev;
|
||||
|
||||
#else
|
||||
NT_TIB *teb = (NT_TIB *)NtCurrentTeb();
|
||||
teb->ExceptionList = (void *)frame->Prev;
|
||||
return frame->Prev;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/* Wine-specific exceptions codes */
|
||||
|
||||
#define EXCEPTION_WINE_STUB 0x80000100 /* stub entry point called */
|
||||
#define EXCEPTION_WINE_ASSERTION 0x80000101 /* assertion failed */
|
||||
|
||||
/* unhandled return status from vm86 mode */
|
||||
#define EXCEPTION_VM86_INTx 0x80000110
|
||||
#define EXCEPTION_VM86_STI 0x80000111
|
||||
#define EXCEPTION_VM86_PICRETURN 0x80000112
|
||||
|
||||
extern void __wine_enter_vm86( CONTEXT *context );
|
||||
|
||||
#endif /* __WINE_WINE_EXCEPTION_H */
|
|
@ -1,27 +1,393 @@
|
|||
/* Missing Defines and structures
|
||||
* These are either missing from the w32api package
|
||||
* the ReactOS build system is broken and needs to
|
||||
* fixed.
|
||||
/*
|
||||
* Wine porting definitions
|
||||
*
|
||||
* Copyright 1996 Alexandre Julliard
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#ifndef _ROS_WINE_PORT
|
||||
#define _ROS_WINE_PORT
|
||||
|
||||
typedef signed char INT8, *PINT8;
|
||||
typedef signed short INT16, *PINT16;
|
||||
typedef signed int INT32, *PINT32;
|
||||
typedef unsigned char UINT8, *PUINT8;
|
||||
typedef unsigned short UINT16, *PUINT16;
|
||||
typedef unsigned int UINT32, *PUINT32;
|
||||
typedef signed int LONG32, *PLONG32;
|
||||
typedef unsigned int ULONG32, *PULONG32;
|
||||
typedef unsigned int DWORD32, *PDWORD32;
|
||||
typedef INT16 *LPINT16;
|
||||
typedef UINT16 *LPUINT16;
|
||||
#ifndef __WINE_WINE_PORT_H
|
||||
#define __WINE_WINE_PORT_H
|
||||
|
||||
#define HFILE_ERROR ((HFILE)-1) /* Already in winbase.h - ros is fubar */
|
||||
#ifndef __WINE_CONFIG_H
|
||||
# error You must include config.h to use this header
|
||||
#endif
|
||||
|
||||
#define strncasecmp strncmp
|
||||
#ifdef __REACTOS__
|
||||
#include "wineros.h" /* Remove in the future */
|
||||
#endif /* __REACTOS__ */
|
||||
|
||||
#define _GNU_SOURCE /* for pread/pwrite */
|
||||
#include <fcntl.h>
|
||||
#include <math.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#ifdef HAVE_DIRECT_H
|
||||
# include <direct.h>
|
||||
#endif
|
||||
#ifdef HAVE_IO_H
|
||||
# include <io.h>
|
||||
#endif
|
||||
#ifdef HAVE_PROCESS_H
|
||||
# include <process.h>
|
||||
#endif
|
||||
#include <string.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
|
||||
/****************************************************************
|
||||
* Type definitions
|
||||
*/
|
||||
|
||||
#ifndef HAVE_MODE_T
|
||||
typedef int mode_t;
|
||||
#endif
|
||||
#ifndef HAVE_OFF_T
|
||||
typedef long off_t;
|
||||
#endif
|
||||
#ifndef HAVE_PID_T
|
||||
typedef int pid_t;
|
||||
#endif
|
||||
#ifndef HAVE_SIZE_T
|
||||
typedef unsigned int size_t;
|
||||
#endif
|
||||
#ifndef HAVE_SSIZE_T
|
||||
typedef int ssize_t;
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STATFS
|
||||
# ifdef __BEOS__
|
||||
# define HAVE_STRUCT_STATFS_F_BFREE
|
||||
struct statfs {
|
||||
long f_bsize; /* block_size */
|
||||
long f_blocks; /* total_blocks */
|
||||
long f_bfree; /* free_blocks */
|
||||
};
|
||||
# else /* defined(__BEOS__) */
|
||||
struct statfs;
|
||||
# endif /* defined(__BEOS__) */
|
||||
#endif /* !defined(HAVE_STATFS) */
|
||||
|
||||
|
||||
/****************************************************************
|
||||
* Macro definitions
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DLFCN_H
|
||||
#include <dlfcn.h>
|
||||
#else
|
||||
#define RTLD_LAZY 0x001
|
||||
#define RTLD_NOW 0x002
|
||||
#define RTLD_GLOBAL 0x100
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_FTRUNCATE) && defined(HAVE_CHSIZE)
|
||||
#define ftruncate chsize
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_POPEN) && defined(HAVE__POPEN)
|
||||
#define popen _popen
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_PCLOSE) && defined(HAVE__PCLOSE)
|
||||
#define pclose _pclose
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_SNPRINTF) && defined(HAVE__SNPRINTF)
|
||||
#define snprintf _snprintf
|
||||
#define strcasecmp _stricmp
|
||||
#endif
|
||||
|
||||
#endif /* _ROS_WINE_PORT */
|
||||
#if !defined(HAVE_VSNPRINTF) && defined(HAVE__VSNPRINTF)
|
||||
#define vsnprintf _vsnprintf
|
||||
#endif
|
||||
|
||||
#ifndef S_ISLNK
|
||||
# define S_ISLNK(mod) (0)
|
||||
#endif /* S_ISLNK */
|
||||
|
||||
/* So we open files in 64 bit access mode on Linux */
|
||||
#ifndef O_LARGEFILE
|
||||
# define O_LARGEFILE 0
|
||||
#endif
|
||||
|
||||
|
||||
/****************************************************************
|
||||
* Constants
|
||||
*/
|
||||
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265358979323846
|
||||
#endif
|
||||
|
||||
#ifndef M_PI_2
|
||||
#define M_PI_2 1.570796326794896619
|
||||
#endif
|
||||
|
||||
|
||||
/* Macros to define assembler functions somewhat portably */
|
||||
|
||||
#ifdef __GNUC__
|
||||
# define __ASM_GLOBAL_FUNC(name,code) \
|
||||
__asm__( ".align 4\n\t" \
|
||||
".globl " __ASM_NAME(#name) "\n\t" \
|
||||
__ASM_FUNC(#name) "\n" \
|
||||
__ASM_NAME(#name) ":\n\t" \
|
||||
code );
|
||||
#else /* __GNUC__ */
|
||||
# define __ASM_GLOBAL_FUNC(name,code) \
|
||||
void __asm_dummy_##name(void) { \
|
||||
asm( ".align 4\n\t" \
|
||||
".globl " __ASM_NAME(#name) "\n\t" \
|
||||
__ASM_FUNC(#name) "\n" \
|
||||
__ASM_NAME(#name) ":\n\t" \
|
||||
code ); \
|
||||
}
|
||||
#endif /* __GNUC__ */
|
||||
|
||||
|
||||
/* Constructor functions */
|
||||
|
||||
#ifdef __GNUC__
|
||||
# define DECL_GLOBAL_CONSTRUCTOR(func) \
|
||||
static void func(void) __attribute__((constructor)); \
|
||||
static void func(void)
|
||||
#elif defined(__i386__)
|
||||
# define DECL_GLOBAL_CONSTRUCTOR(func) \
|
||||
static void __dummy_init_##func(void) { \
|
||||
asm(".section .init,\"ax\"\n\t" \
|
||||
"call " #func "\n\t" \
|
||||
".previous"); } \
|
||||
static void func(void)
|
||||
#elif defined(__sparc__)
|
||||
# define DECL_GLOBAL_CONSTRUCTOR(func) \
|
||||
static void __dummy_init_##func(void) { \
|
||||
asm("\t.section \".init\",#alloc,#execinstr\n" \
|
||||
"\tcall " #func "\n" \
|
||||
"\tnop\n" \
|
||||
"\t.section \".text\",#alloc,#execinstr\n" ); } \
|
||||
static void func(void)
|
||||
#else
|
||||
# error You must define the DECL_GLOBAL_CONSTRUCTOR macro for your platform
|
||||
#endif
|
||||
|
||||
|
||||
/* Register functions */
|
||||
|
||||
#ifdef __i386__
|
||||
#define DEFINE_REGS_ENTRYPOINT( name, fn, args, pop_args ) \
|
||||
__ASM_GLOBAL_FUNC( name, \
|
||||
"call " __ASM_NAME("__wine_call_from_32_regs") "\n\t" \
|
||||
".long " __ASM_NAME(#fn) "\n\t" \
|
||||
".byte " #args "," #pop_args )
|
||||
/* FIXME: add support for other CPUs */
|
||||
#endif /* __i386__ */
|
||||
|
||||
|
||||
/****************************************************************
|
||||
* Function definitions (only when using libwine_port)
|
||||
*/
|
||||
|
||||
#ifndef NO_LIBWINE_PORT
|
||||
|
||||
#ifndef HAVE_GETOPT_LONG
|
||||
extern char *optarg;
|
||||
extern int optind;
|
||||
extern int opterr;
|
||||
extern int optopt;
|
||||
struct option;
|
||||
|
||||
#ifndef HAVE_STRUCT_OPTION_NAME
|
||||
struct option
|
||||
{
|
||||
const char *name;
|
||||
int has_arg;
|
||||
int *flag;
|
||||
int val;
|
||||
};
|
||||
#endif
|
||||
|
||||
extern int getopt_long (int ___argc, char *const *___argv,
|
||||
const char *__shortopts,
|
||||
const struct option *__longopts, int *__longind);
|
||||
extern int getopt_long_only (int ___argc, char *const *___argv,
|
||||
const char *__shortopts,
|
||||
const struct option *__longopts, int *__longind);
|
||||
#endif /* HAVE_GETOPT_LONG */
|
||||
|
||||
#ifndef HAVE_GETPAGESIZE
|
||||
size_t getpagesize(void);
|
||||
#endif /* HAVE_GETPAGESIZE */
|
||||
|
||||
#ifndef HAVE_GETTID
|
||||
pid_t gettid(void);
|
||||
#endif /* HAVE_GETTID */
|
||||
|
||||
#ifndef HAVE_LSTAT
|
||||
int lstat(const char *file_name, struct stat *buf);
|
||||
#endif /* HAVE_LSTAT */
|
||||
|
||||
#ifndef HAVE_MEMMOVE
|
||||
void *memmove(void *dest, const void *src, size_t len);
|
||||
#endif /* !defined(HAVE_MEMMOVE) */
|
||||
|
||||
#ifndef HAVE_PREAD
|
||||
ssize_t pread( int fd, void *buf, size_t count, off_t offset );
|
||||
#endif /* HAVE_PREAD */
|
||||
|
||||
#ifndef HAVE_PWRITE
|
||||
ssize_t pwrite( int fd, const void *buf, size_t count, off_t offset );
|
||||
#endif /* HAVE_PWRITE */
|
||||
|
||||
#ifndef HAVE_SIGSETJMP
|
||||
# include <setjmp.h>
|
||||
typedef jmp_buf sigjmp_buf;
|
||||
int sigsetjmp( sigjmp_buf buf, int savesigs );
|
||||
void siglongjmp( sigjmp_buf buf, int val );
|
||||
#endif /* HAVE_SIGSETJMP */
|
||||
|
||||
#ifndef HAVE_STATFS
|
||||
int statfs(const char *name, struct statfs *info);
|
||||
#endif /* !defined(HAVE_STATFS) */
|
||||
|
||||
#ifndef HAVE_STRNCASECMP
|
||||
# ifndef HAVE__STRNICMP
|
||||
int strncasecmp(const char *str1, const char *str2, size_t n);
|
||||
# else
|
||||
# define strncasecmp _strnicmp
|
||||
# endif
|
||||
#endif /* !defined(HAVE_STRNCASECMP) */
|
||||
|
||||
#ifndef HAVE_STRERROR
|
||||
const char *strerror(int err);
|
||||
#endif /* !defined(HAVE_STRERROR) */
|
||||
|
||||
#ifndef HAVE_STRCASECMP
|
||||
# ifndef HAVE__STRICMP
|
||||
int strcasecmp(const char *str1, const char *str2);
|
||||
# else
|
||||
# define strcasecmp _stricmp
|
||||
# endif
|
||||
#endif /* !defined(HAVE_STRCASECMP) */
|
||||
|
||||
#ifndef HAVE_USLEEP
|
||||
int usleep (unsigned int useconds);
|
||||
#endif /* !defined(HAVE_USLEEP) */
|
||||
|
||||
#ifdef __i386__
|
||||
static inline void *memcpy_unaligned( void *dst, const void *src, size_t size )
|
||||
{
|
||||
return memcpy( dst, src, size );
|
||||
}
|
||||
#else
|
||||
extern void *memcpy_unaligned( void *dst, const void *src, size_t size );
|
||||
#endif /* __i386__ */
|
||||
|
||||
extern int mkstemps(char *template, int suffix_len);
|
||||
|
||||
/* Process creation flags */
|
||||
#ifndef _P_WAIT
|
||||
# define _P_WAIT 0
|
||||
# define _P_NOWAIT 1
|
||||
# define _P_OVERLAY 2
|
||||
# define _P_NOWAITO 3
|
||||
# define _P_DETACH 4
|
||||
#endif
|
||||
#ifndef HAVE_SPAWNVP
|
||||
extern int spawnvp(int mode, const char *cmdname, const char * const argv[]);
|
||||
#endif
|
||||
|
||||
/* Interlocked functions */
|
||||
|
||||
#if defined(__i386__) && defined(__GNUC__)
|
||||
|
||||
extern inline long interlocked_cmpxchg( long *dest, long xchg, long compare )
|
||||
{
|
||||
long ret;
|
||||
__asm__ __volatile__( "lock; cmpxchgl %2,(%1)"
|
||||
: "=a" (ret) : "r" (dest), "r" (xchg), "0" (compare) : "memory" );
|
||||
return ret;
|
||||
}
|
||||
|
||||
extern inline void *interlocked_cmpxchg_ptr( void **dest, void *xchg, void *compare )
|
||||
{
|
||||
void *ret;
|
||||
__asm__ __volatile__( "lock; cmpxchgl %2,(%1)"
|
||||
: "=a" (ret) : "r" (dest), "r" (xchg), "0" (compare) : "memory" );
|
||||
return ret;
|
||||
}
|
||||
|
||||
extern inline long interlocked_xchg( long *dest, long val )
|
||||
{
|
||||
long ret;
|
||||
__asm__ __volatile__( "lock; xchgl %0,(%1)"
|
||||
: "=r" (ret) : "r" (dest), "0" (val) : "memory" );
|
||||
return ret;
|
||||
}
|
||||
|
||||
extern inline void *interlocked_xchg_ptr( void **dest, void *val )
|
||||
{
|
||||
void *ret;
|
||||
__asm__ __volatile__( "lock; xchgl %0,(%1)"
|
||||
: "=r" (ret) : "r" (dest), "0" (val) : "memory" );
|
||||
return ret;
|
||||
}
|
||||
|
||||
extern inline long interlocked_xchg_add( long *dest, long incr )
|
||||
{
|
||||
long ret;
|
||||
__asm__ __volatile__( "lock; xaddl %0,(%1)"
|
||||
: "=r" (ret) : "r" (dest), "0" (incr) : "memory" );
|
||||
return ret;
|
||||
}
|
||||
|
||||
#else /* __i386___ && __GNUC__ */
|
||||
|
||||
extern long interlocked_cmpxchg( long *dest, long xchg, long compare );
|
||||
extern void *interlocked_cmpxchg_ptr( void **dest, void *xchg, void *compare );
|
||||
extern long interlocked_xchg( long *dest, long val );
|
||||
extern void *interlocked_xchg_ptr( void **dest, void *val );
|
||||
extern long interlocked_xchg_add( long *dest, long incr );
|
||||
|
||||
#endif /* __i386___ && __GNUC__ */
|
||||
|
||||
#else /* NO_LIBWINE_PORT */
|
||||
|
||||
#define __WINE_NOT_PORTABLE(func) func##_is_not_portable func##_is_not_portable
|
||||
|
||||
#define getopt_long __WINE_NOT_PORTABLE(getopt_long)
|
||||
#define getopt_long_only __WINE_NOT_PORTABLE(getopt_long_only)
|
||||
#define getpagesize __WINE_NOT_PORTABLE(getpagesize)
|
||||
#define interlocked_cmpxchg __WINE_NOT_PORTABLE(interlocked_cmpxchg)
|
||||
#define interlocked_cmpxchg_ptr __WINE_NOT_PORTABLE(interlocked_cmpxchg_ptr)
|
||||
#define interlocked_xchg __WINE_NOT_PORTABLE(interlocked_xchg)
|
||||
#define interlocked_xchg_ptr __WINE_NOT_PORTABLE(interlocked_xchg_ptr)
|
||||
#define interlocked_xchg_add __WINE_NOT_PORTABLE(interlocked_xchg_add)
|
||||
#define lstat __WINE_NOT_PORTABLE(lstat)
|
||||
#define memcpy_unaligned __WINE_NOT_PORTABLE(memcpy_unaligned)
|
||||
#define memmove __WINE_NOT_PORTABLE(memmove)
|
||||
#define pread __WINE_NOT_PORTABLE(pread)
|
||||
#define pwrite __WINE_NOT_PORTABLE(pwrite)
|
||||
#define spawnvp __WINE_NOT_PORTABLE(spawnvp)
|
||||
#define statfs __WINE_NOT_PORTABLE(statfs)
|
||||
#define strcasecmp __WINE_NOT_PORTABLE(strcasecmp)
|
||||
#define strerror __WINE_NOT_PORTABLE(strerror)
|
||||
#define strncasecmp __WINE_NOT_PORTABLE(strncasecmp)
|
||||
#define usleep __WINE_NOT_PORTABLE(usleep)
|
||||
|
||||
#endif /* NO_LIBWINE_PORT */
|
||||
|
||||
#endif /* !defined(__WINE_WINE_PORT_H) */
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
/* Missing Defines and structures
|
||||
* These are either missing from the w32api package
|
||||
* the ReactOS build system is broken and needs to
|
||||
* fixed.
|
||||
*/
|
||||
|
||||
/* Wine wrapper for ReactOS */
|
||||
#ifndef __REACTOS_WINE_WINEROS_H
|
||||
#define __REACTOS_WINE_WINEROS_H
|
||||
|
@ -5,6 +11,28 @@
|
|||
typedef unsigned short u_short;
|
||||
typedef unsigned long u_long;
|
||||
|
||||
#define FD_SETSIZE 64
|
||||
typedef signed char INT8, *PINT8;
|
||||
typedef signed short INT16, *PINT16;
|
||||
typedef signed int INT32, *PINT32;
|
||||
typedef unsigned char UINT8, *PUINT8;
|
||||
typedef unsigned short UINT16, *PUINT16;
|
||||
typedef unsigned int UINT32, *PUINT32;
|
||||
typedef signed int LONG32, *PLONG32;
|
||||
typedef unsigned int ULONG32, *PULONG32;
|
||||
typedef unsigned int DWORD32, *PDWORD32;
|
||||
typedef INT16 *LPINT16;
|
||||
typedef UINT16 *LPUINT16;
|
||||
|
||||
#endif /* __REACTOS_WINE_WINEROS_H */
|
||||
#ifndef HFILE_ERROR
|
||||
#define HFILE_ERROR ((HFILE)-1) /* Already in winbase.h - ros is fubar */
|
||||
#endif
|
||||
|
||||
#define strncasecmp strncmp
|
||||
#define snprintf _snprintf
|
||||
#define strcasecmp _stricmp
|
||||
|
||||
#ifndef FD_SETSIZE
|
||||
#define FD_SETSIZE 64
|
||||
#endif
|
||||
|
||||
#endif /* __REACTOS_WINE_WINEROS_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue