Ticket #9205: hawine.patch

File hawine.patch, 11.6 KB (added by AndreH, 7 years ago)

hack to compile Wine on Haiku

  • dlls/iphlpapi/ifenum.c

    diff --git a/dlls/iphlpapi/ifenum.c b/dlls/iphlpapi/ifenum.c
    index aff88cd..b0feed4 100644
    a b static DWORD getInterfaceMaskByName(const char *name)  
    304304  return ret;
    305305}
    306306
     307static DWORD getInterfacePhysicalByName(const char *name, PDWORD len, PBYTE addr, PDWORD type)
     308{
     309    *len=0;
     310    *type=0;
     311    return ERROR_NOT_SUPPORTED;
     312}
     313
    307314#if defined (SIOCGIFHWADDR) && defined (HAVE_STRUCT_IFREQ_IFR_HWADDR)
    308315static DWORD getInterfacePhysicalByName(const char *name, PDWORD len, PBYTE addr,
    309316 PDWORD type)
  • dlls/ntdll/serial.c

    diff --git a/dlls/ntdll/serial.c b/dlls/ntdll/serial.c
    index 231466c..79ee613 100644
    a b static NTSTATUS get_line_control(int fd, SERIAL_LINE_CONTROL* slc)  
    260260    }
    261261    switch (port.c_cflag & CSIZE)
    262262    {
     263/*
    263264    case CS5:   slc->WordLength = 5;    break;
    264265    case CS6:   slc->WordLength = 6;    break;
     266*/
    265267    case CS7:   slc->WordLength = 7;    break;
    266268    case CS8:   slc->WordLength = 8;    break;
    267269    default: ERR("unknown size %x\n", (UINT)(port.c_cflag & CSIZE));
  • dlls/ntdll/server.c

    diff --git a/dlls/ntdll/server.c b/dlls/ntdll/server.c
    index 2fe7877..bbc7498 100644
    a b void server_init_process(void)  
    10021002    /* setup the signal mask */
    10031003    sigemptyset( &server_block_set );
    10041004    sigaddset( &server_block_set, SIGALRM );
    1005     sigaddset( &server_block_set, SIGIO );
     1005/*    sigaddset( &server_block_set, SIGIO ); */
    10061006    sigaddset( &server_block_set, SIGINT );
    10071007    sigaddset( &server_block_set, SIGHUP );
    10081008    sigaddset( &server_block_set, SIGUSR1 );
  • dlls/ntdll/signal_i386.c

    diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c
    index 4a83a70..d7c7463 100644
    a b typedef ucontext_t SIGCONTEXT;  
    399399#define T_MCHK T_MCA
    400400#define T_XMMFLT T_XMM
    401401
     402#elif defined(__HAIKU__)
     403# include <sys/types.h>
     404# include <signal.h>
     405
     406typedef ucontext_t SIGCONTEXT;
     407
     408#define EAX_sig(context) ((context)->uc_mcontext.eax)
     409#define EBX_sig(context) ((context)->uc_mcontext.ebx)
     410#define ECX_sig(context) ((context)->uc_mcontext.ecx)
     411#define EDX_sig(context) ((context)->uc_mcontext.edx)
     412#define ESI_sig(context) ((context)->uc_mcontext.esi)
     413#define EDI_sig(context) ((context)->uc_mcontext.edi)
     414#define EBP_sig(context) ((context)->uc_mcontext.ebp)
     415#define ESP_sig(context) ((context)->uc_mcontext.esp)
     416
     417#define CS_sig(context) ((context)->uc_mcontext.xregs.state.new_format.fp_cs)
     418#define DS_sig(context) ((context)->uc_mcontext.xregs.state.new_format.fp_ds)
     419/*#define ES_sig(context) NULL*/
     420/*#define SS_sig(context) NULL*/
     421/*#define FS_sig(context) NULL*/
     422/*#define GS_sig(context) NULL*/
     423
     424#define EFL_sig(context) ((context)->uc_mcontext.eflags)
     425#define EIP_sig(context) ((context)->uc_mcontext.eip)
     426/*#define TRAP_sig(context) NULL*/
     427/*#define ERROR_sig(context) NULL*/
     428
     429#define FPU_sig(context) NULL
     430#define FPUX_sig(context) NULL
     431
     432#define T_MCHK T_MCA
     433#define T_XMMFLT T_XMM
     434
    402435#else
    403436#error You must define the signal context functions for your platform
    404437#endif /* linux */
    static inline void *init_handler( const SIGCONTEXT *sigcontext, WORD *fs, WORD *  
    915948    }
    916949#endif
    917950
    918     if (!wine_ldt_is_system(CS_sig(sigcontext)) ||
    919         !wine_ldt_is_system(SS_sig(sigcontext)))  /* 16-bit mode */
     951    if (!wine_ldt_is_system(CS_sig(sigcontext)))
    920952    {
    921953        /*
    922954         * Win16 or DOS protected mode. Note that during switch
    static inline void save_context( CONTEXT *context, const SIGCONTEXT *sigcontext,  
    10711103    context->Esp          = ESP_sig(sigcontext);
    10721104    context->SegCs        = LOWORD(CS_sig(sigcontext));
    10731105    context->SegDs        = LOWORD(DS_sig(sigcontext));
    1074     context->SegEs        = LOWORD(ES_sig(sigcontext));
     1106/*    context->SegEs        = LOWORD(ES_sig(sigcontext)); */
    10751107    context->SegFs        = fs;
    10761108    context->SegGs        = gs;
    1077     context->SegSs        = LOWORD(SS_sig(sigcontext));
     1109/*    context->SegSs        = LOWORD(SS_sig(sigcontext)); */
    10781110    context->Dr0          = regs->dr0;
    10791111    context->Dr1          = regs->dr1;
    10801112    context->Dr2          = regs->dr2;
    static inline void restore_context( const CONTEXT *context, SIGCONTEXT *sigconte  
    11271159    ESP_sig(sigcontext) = context->Esp;
    11281160    CS_sig(sigcontext)  = context->SegCs;
    11291161    DS_sig(sigcontext)  = context->SegDs;
    1130     ES_sig(sigcontext)  = context->SegEs;
    1131     SS_sig(sigcontext)  = context->SegSs;
     1162/*    ES_sig(sigcontext)  = context->SegEs; */
     1163/*    SS_sig(sigcontext)  = context->SegSs; */
    11321164#ifdef GS_sig
    11331165    GS_sig(sigcontext)  = context->SegGs;
    11341166#else
    static EXCEPTION_RECORD *setup_exception_record( SIGCONTEXT *sigcontext, void *s  
    16391671    EFL_sig(sigcontext) &= ~(0x100|0x400|0x40000);
    16401672    CS_sig(sigcontext)  = wine_get_cs();
    16411673    DS_sig(sigcontext)  = wine_get_ds();
    1642     ES_sig(sigcontext)  = wine_get_es();
    1643     FS_sig(sigcontext)  = wine_get_fs();
    1644     GS_sig(sigcontext)  = wine_get_gs();
    1645     SS_sig(sigcontext)  = wine_get_ss();
     1674/*    ES_sig(sigcontext)  = wine_get_es(); */
     1675/*    FS_sig(sigcontext)  = wine_get_fs(); */
     1676/*    GS_sig(sigcontext)  = wine_get_gs(); */
     1677/*    SS_sig(sigcontext)  = wine_get_ss(); */
    16461678
    16471679    return stack->rec_ptr;
    16481680}
  • dlls/ntdll/thread.c

    diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c
    index 8f8fdcf..13b94c5 100644
    a b NTSTATUS WINAPI RtlCreateUserThread( HANDLE process, const SECURITY_DESCRIPTOR *  
    502502    if ((status = virtual_alloc_thread_stack( teb, stack_reserve, stack_commit ))) goto error;
    503503
    504504    pthread_attr_init( &attr );
    505     pthread_attr_setstack( &attr, teb->DeallocationStack,
    506                            (char *)teb->Tib.StackBase - (char *)teb->DeallocationStack );
     505/*    pthread_attr_setstack( &attr, teb->DeallocationStack,
     506                           (char *)teb->Tib.StackBase - (char *)teb->DeallocationStack );*/
    507507    pthread_attr_setscope( &attr, PTHREAD_SCOPE_SYSTEM ); /* force creating a kernel thread */
    508508    interlocked_xchg_add( &nb_threads, 1 );
    509509    if (pthread_create( &pthread_id, &attr, (void * (*)(void *))start_thread, info ))
  • dlls/ntdll/virtual.c

    diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c
    index 88bcdbb..324fcb6 100644
    a b NTSTATUS WINAPI NtAllocateVirtualMemory( HANDLE process, PVOID *ret, ULONG zero_  
    19401940    else if (type & MEM_RESET)
    19411941    {
    19421942        if (!(view = VIRTUAL_FindView( base, size ))) status = STATUS_NOT_MAPPED_VIEW;
    1943         else madvise( base, size, MADV_DONTNEED );
     1943        else posix_madvise( base, size, POSIX_MADV_DONTNEED );
    19441944    }
    19451945    else  /* commit the pages */
    19461946    {
    NTSTATUS WINAPI NtLockVirtualMemory( HANDLE process, PVOID *addr, SIZE_T *size,  
    23832383    *size = ROUND_SIZE( *addr, *size );
    23842384    *addr = ROUND_ADDR( *addr, page_mask );
    23852385
    2386     if (mlock( *addr, *size )) status = STATUS_ACCESS_DENIED;
     2386/*    if (mlock( *addr, *size )) status = STATUS_ACCESS_DENIED; */
    23872387    return status;
    23882388}
    23892389
    NTSTATUS WINAPI NtUnlockVirtualMemory( HANDLE process, PVOID *addr, SIZE_T *size  
    24202420    *size = ROUND_SIZE( *addr, *size );
    24212421    *addr = ROUND_ADDR( *addr, page_mask );
    24222422
    2423     if (munlock( *addr, *size )) status = STATUS_ACCESS_DENIED;
     2423/*    if (munlock( *addr, *size )) status = STATUS_ACCESS_DENIED; */
    24242424    return status;
    24252425}
    24262426
  • dlls/rpcrt4/rpc_transport.c

    diff --git a/dlls/rpcrt4/rpc_transport.c b/dlls/rpcrt4/rpc_transport.c
    index aebb05e..ebd7026 100644
    a b  
    8383#include "wininet.h"
    8484#include "winternl.h"
    8585#include "wine/unicode.h"
     86//#include "winsock.h"
    8687
    8788#include "rpc.h"
    8889#include "rpcndr.h"
    typedef struct _RpcConnection_tcp  
    10201021{
    10211022  RpcConnection common;
    10221023  int sock;
    1023 #ifdef HAVE_SOCKETPAIR
     1024#if 1 //def HAVE_SOCKETPAIR
    10241025  int cancel_fds[2];
    10251026#else
    10261027  HANDLE sock_event;
    typedef struct _RpcConnection_tcp  
    10281029#endif
    10291030} RpcConnection_tcp;
    10301031
    1031 #ifdef HAVE_SOCKETPAIR
     1032#if 1
    10321033
    10331034static BOOL rpcrt4_sock_wait_init(RpcConnection_tcp *tcpc)
    10341035{
    static size_t rpcrt4_ncacn_ip_tcp_get_top_of_tower(unsigned char *tower_data,  
    15381539                                          EPM_PROTOCOL_TCP, endpoint);
    15391540}
    15401541
    1541 #ifdef HAVE_SOCKETPAIR
     1542#if 1 //def HAVE_SOCKETPAIR
    15421543
    15431544typedef struct _RpcServerProtseq_sock
    15441545{
  • dlls/winhttp/net.c

    diff --git a/dlls/winhttp/net.c b/dlls/winhttp/net.c
    index 5ec4e1a..3516a3b 100644
    a b  
    5959#define USE_WS_PREFIX
    6060#include "winsock2.h"
    6161
     62#define ESOCKTNOSUPPORT 94
     63#define ETOOMANYREFS    109
     64
    6265WINE_DEFAULT_DEBUG_CHANNEL(winhttp);
    6366
    6467#ifndef HAVE_GETADDRINFO
  • dlls/wininet/netconnection.c

    diff --git a/dlls/wininet/netconnection.c b/dlls/wininet/netconnection.c
    index b746b54..ab79d2d 100644
    a b  
    9191
    9292#define RESPONSE_TIMEOUT        30            /* FROM internet.c */
    9393
     94#define ESOCKTNOSUPPORT 94
     95#define ETOOMANYREFS    109
    9496
    9597WINE_DEFAULT_DEBUG_CHANNEL(wininet);
    9698
  • dlls/ws2_32/socket.c

    diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
    index 5c69d21..e5b2031 100644
    a b  
    170170#define INADDR_NONE ~0UL
    171171#endif
    172172
     173#define ESOCKTNOSUPPORT 94
     174#define ETOOMANYREFS    109
     175
    173176WINE_DEFAULT_DEBUG_CHANNEL(winsock);
    174177WINE_DECLARE_DEBUG_CHANNEL(winediag);
    175178
  • server/change.c

    diff --git a/server/change.c b/server/change.c
    index f6d56b0..28d3f93 100644
    a b static void dnotify_adjust_changes( struct dir *dir )  
    190190    int fd = get_unix_fd( dir->fd );
    191191    unsigned int filter = dir->filter;
    192192    unsigned int val;
    193     if ( 0 > fcntl( fd, F_SETSIG, SIGIO) )
    194         return;
     193//    if ( 0 > fcntl( fd, F_SETSIG, SIGIO) )
     194//        return;
    195195
    196196    val = DN_MULTISHOT;
    197197    if (filter & FILE_NOTIFY_CHANGE_FILE_NAME)
    static inline void insert_change( struct dir *dir )  
    220220    sigset_t sigset;
    221221
    222222    sigemptyset( &sigset );
    223     sigaddset( &sigset, SIGIO );
     223//    sigaddset( &sigset, SIGIO );
    224224    sigprocmask( SIG_BLOCK, &sigset, NULL );
    225225    list_add_head( &change_list, &dir->entry );
    226226    sigprocmask( SIG_UNBLOCK, &sigset, NULL );
    static inline void remove_change( struct dir *dir )  
    232232    sigset_t sigset;
    233233
    234234    sigemptyset( &sigset );
    235     sigaddset( &sigset, SIGIO );
     235//    sigaddset( &sigset, SIGIO );
    236236    sigprocmask( SIG_BLOCK, &sigset, NULL );
    237237    list_remove( &dir->entry );
    238238    sigprocmask( SIG_UNBLOCK, &sigset, NULL );
  • server/process.h

    diff --git a/server/process.h b/server/process.h
    index f216ecd..7c62336 100644
    a b struct startup_info;  
    3030/* process startup state */
    3131enum startup_state { STARTUP_IN_PROGRESS, STARTUP_DONE, STARTUP_ABORTED };
    3232
     33#ifdef __HAIKU__
     34    #define wait4(pid, status, options, rusage) waitpid(pid, status, options)
     35#endif
     36
    3337/* process structures */
    3438
    3539struct process_dll
  • server/signal.c

    diff --git a/server/signal.c b/server/signal.c
    index 5e4fe33..fc21ae9 100644
    a b void init_signals(void)  
    283283    sigaddset( &blocked_sigset, SIGHUP );
    284284    sigaddset( &blocked_sigset, SIGINT );
    285285    sigaddset( &blocked_sigset, SIGALRM );
    286     sigaddset( &blocked_sigset, SIGIO );
     286//    sigaddset( &blocked_sigset, SIGIO );
    287287    sigaddset( &blocked_sigset, SIGQUIT );
    288288    sigaddset( &blocked_sigset, SIGTERM );
    289289#ifdef SIG_PTHREAD_CANCEL
  • server/sock.c

    diff --git a/server/sock.c b/server/sock.c
    index 7dcc101..44fd6f0 100644
    a b static int sock_get_ntstatus( int err );  
    124124static int sock_get_error( int err );
    125125static void sock_set_error(void);
    126126
     127
     128#define ESOCKTNOSUPPORT 94
     129#define ETOOMANYREFS    109
     130
     131
    127132static const struct object_ops sock_ops =
    128133{
    129134    sizeof(struct sock),          /* size */