Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/configure-xsdl.sh b/configure-xsdl.sh
- index 37549791a..db9d8862c 100755
- --- a/configure-xsdl.sh
- +++ b/configure-xsdl.sh
- @@ -7,4 +7,4 @@ env SDL=yes CFLAGS="-O0 -g -DDEBUG" \
- --disable-shm --disable-mitshm --disable-dri --disable-dri2 --disable-glx --disable-xf86vidmode \
- --enable-xsdl --enable-kdrive --enable-kdrive-kbd --enable-kdrive-mouse --enable-kdrive-evdev \
- -nice -n19 make -j8
- +make -j16
- diff --git a/hw/kdrive/sdl/sdl.c b/hw/kdrive/sdl/sdl.c
- index 437146561..9e1f231c4 100644
- --- a/hw/kdrive/sdl/sdl.c
- +++ b/hw/kdrive/sdl/sdl.c
- @@ -36,7 +36,9 @@
- #include <sys/socket.h>
- #include <sys/un.h>
- #include <pthread.h>
- +#ifndef __HAIKU__
- #include <sys/inotify.h>
- +#endif
- #include <fcntl.h>
- #ifdef __ANDROID__
- @@ -213,11 +215,12 @@ static Bool sdlScreenInit(KdScreenInfo *screen)
- SDL_EnableUNICODE(1);
- SDL_EventState(SDL_SYSWMEVENT, SDL_ENABLE);
- +#ifndef __HAIKU__
- set_clipboard_text(SDL_GetClipboardText());
- sdlScreenButtons = SDL_ANDROID_GetScreenKeyboardButtonShown(SDL_ANDROID_SCREENKEYBOARD_BUTTON_0);
- setScreenButtons(10000);
- -
- +#endif
- if (getenv("XSDL_BUILTIN_KEYBOARD") != NULL)
- sdlKeyboardType = (enum sdlKeyboardType_t) atoi(getenv("XSDL_BUILTIN_KEYBOARD"));
- unsetenv("XSDL_BUILTIN_KEYBOARD");
- @@ -749,10 +752,10 @@ static void sdlPollInput(void)
- KdEnqueueKeyboardEvent (sdlKeyboard, 37, 1); // LCTRL
- }
- }
- - else if((event.key.keysym.unicode & 0xFF80) != 0)
- +/* else if((event.key.keysym.unicode & 0xFF80) != 0)
- {
- send_unicode (event.key.keysym.unicode);
- - }
- + }*/
- else
- KdEnqueueKeyboardEvent (sdlKeyboard, event.key.keysym.scancode, event.type==SDL_KEYUP);
- // Force SDL screen update, so SDL virtual on-screen buttons will change their images
- @@ -775,13 +778,16 @@ static void sdlPollInput(void)
- // Oherwise SDL will stuck and we will get a permanent black screen
- SDL_Flip(SDL_GetVideoSurface());
- break;
- +#ifndef __HAIKU__
- case SDL_SYSWMEVENT:
- if (event.syswm.msg != NULL && event.syswm.msg->type == SDL_SYSWM_ANDROID_CLIPBOARD_CHANGED)
- set_clipboard_text(SDL_GetClipboardText());
- break;
- - //case SDL_QUIT:
- +#endif
- + case SDL_QUIT:
- /* this should never happen */
- - //SDL_Quit(); // SDL_Quit() on Android is buggy
- + SDL_Quit(); // SDL_Quit() on Android is buggy
- + break;
- }
- }
- /*
- @@ -795,7 +801,7 @@ static void sdlPollInput(void)
- }
- static Bool xsdlConnectionClosed = 0;
- -
- +#ifndef __HAIKU__
- static void xsdlAudioCallback(void *userdata, Uint8 *stream, int len)
- {
- int fd = (int)userdata;
- @@ -953,13 +959,15 @@ static void xsdlCreateAudioThread()
- pthread_create(&threadId, NULL, &xsdlAudioThread, NULL);
- pthread_detach(threadId);
- }
- -
- +#endif
- static int xsdlInit(void)
- {
- printf("Calling SDL_Init()\n");
- SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_AUDIO);
- SDL_JoystickOpen(0); // Receive pressure events
- +#ifndef __HAIKU__
- xsdlCreateAudioThread();
- +#endif
- return 0;
- }
- @@ -984,6 +992,7 @@ void OsVendorInit (void)
- {
- KdOsInit (&sdlOsFuncs);
- }
- +/*
- static void *send_unicode_thread(void *param)
- {
- @@ -1002,7 +1011,6 @@ static void *send_unicode_thread(void *param)
- KdEnqueueKeyboardEvent (sdlKeyboard, 37, 1); // LCTRL
- return NULL;
- }
- -
- static void *set_clipboard_text_thread(void *param)
- {
- // International text input - copy symbol to clipboard, and send copypaste key
- @@ -1035,7 +1043,7 @@ void set_clipboard_text(const char *text)
- pthread_create (&thread_id, &attr, &set_clipboard_text_thread, (void *)text);
- pthread_attr_destroy (&attr);
- }
- -
- +*/
- int execute_command(const char * command, const char *mode, char * data, int datalen)
- {
- FILE *cmd;
- diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c
- index d258aebb4..2558d62a2 100644
- --- a/hw/kdrive/src/kinput.c
- +++ b/hw/kdrive/src/kinput.c
- @@ -38,6 +38,12 @@
- #include <sys/file.h> /* needed for FNONBLOCK & FASYNC */
- #endif
- +#ifdef __HAIKU__
- +#define SIGIO SIGPOLL
- +#define FASYNC 0
- +#define FNONBLOCK O_NONBLOCK
- +#endif
- +
- #include "xkbsrv.h"
- #include <X11/extensions/XI.h>
- @@ -176,7 +182,9 @@ KdAddFd (int fd)
- sigset_t set;
- kdnFds++;
- +#ifndef __HAIKU__
- fcntl (fd, F_SETOWN, getpid());
- +#endif
- KdNonBlockFd (fd);
- AddEnabledDevice (fd);
- memset (&act, '\0', sizeof act);
- diff --git a/os/WaitFor.c b/os/WaitFor.c
- index 867cb04b8..902683364 100644
- --- a/os/WaitFor.c
- +++ b/os/WaitFor.c
- @@ -335,11 +335,11 @@ WaitForSomething(int *pClientsReady)
- {
- int highest_priority = 0;
- - while (clientsReadable.fds_bits[i])
- + while (clientsReadable.bits[i])
- {
- int client_priority, client_index;
- - curclient = mffs (clientsReadable.fds_bits[i]) - 1;
- + curclient = mffs (clientsReadable.bits[i]) - 1;
- client_index = /* raphael: modified */
- ConnectionTranslation[curclient + (i * (sizeof(fd_mask) * 8))];
- #else
- @@ -383,7 +383,7 @@ WaitForSomething(int *pClientsReady)
- pClientsReady[nready++] = client_index;
- }
- #ifndef WIN32
- - clientsReadable.fds_bits[i] &= ~(((fd_mask)1L) << curclient);
- + clientsReadable.bits[i] &= ~(((fd_mask)1L) << curclient);
- }
- #else
- FD_CLR(curclient, &clientsReadable);
- diff --git a/os/access.c b/os/access.c
- index b7b19279f..1aba590e1 100644
- --- a/os/access.c
- +++ b/os/access.c
- @@ -84,6 +84,11 @@ SOFTWARE.
- #include <X11/Xwinsock.h>
- #endif
- +#ifdef __HAIKU__
- +#undef AF_INET6
- +#undef IPv6
- +#endif
- +
- #include <stdio.h>
- #include <stdlib.h>
- #define XSERV_t
- @@ -113,7 +118,7 @@ SOFTWARE.
- # endif
- #endif
- -#if defined(SVR4) || (defined(SYSV) && defined(__i386__)) || defined(__GNU__)
- +#if defined(SVR4) || (defined(SYSV) && defined(__i386__)) || defined(__GNU__) || defined(__HAIKU__)
- # include <sys/utsname.h>
- #endif
- #if defined(SYSV) && defined(__i386__)
- diff --git a/os/connection.c b/os/connection.c
- index cbce6d53b..22756765c 100644
- --- a/os/connection.c
- +++ b/os/connection.c
- @@ -814,7 +814,7 @@ EstablishNewConnections(ClientPtr clientUnused, pointer closure)
- #ifndef WIN32
- for (i = 0; i < howmany(XFD_SETSIZE, NFDBITS); i++)
- {
- - while (readyconnections.fds_bits[i])
- + while (readyconnections.bits[i])
- #else
- for (i = 0; i < XFD_SETCOUNT(&readyconnections); i++)
- #endif
- @@ -823,8 +823,8 @@ EstablishNewConnections(ClientPtr clientUnused, pointer closure)
- int status;
- #ifndef WIN32
- - curconn = mffs (readyconnections.fds_bits[i]) - 1;
- - readyconnections.fds_bits[i] &= ~((fd_mask)1 << curconn);
- + curconn = mffs (readyconnections.bits[i]) - 1;
- + readyconnections.bits[i] &= ~((fd_mask)1 << curconn);
- curconn += (i * (sizeof(fd_mask)*8));
- #else
- curconn = XFD_FD(&readyconnections, i);
- @@ -984,7 +984,7 @@ CheckConnections(void)
- #ifndef WIN32
- for (i=0; i<howmany(XFD_SETSIZE, NFDBITS); i++)
- {
- - mask = AllClients.fds_bits[i];
- + mask = AllClients.bits[i];
- while (mask)
- {
- curoff = mffs (mask) - 1;
- diff --git a/os/io.c b/os/io.c
- index c59e18c5e..10b5e2189 100644
- --- a/os/io.c
- +++ b/os/io.c
- @@ -660,8 +660,8 @@ FlushAllOutput(void)
- #ifndef WIN32
- for (base = 0; base < howmany(XFD_SETSIZE, NFDBITS); base++)
- {
- - mask = OutputPending.fds_bits[ base ];
- - OutputPending.fds_bits[ base ] = 0;
- + mask = OutputPending.bits[ base ];
- + OutputPending.bits[ base ] = 0;
- while (mask)
- {
- index = ffs(mask) - 1;
- diff --git a/start.sh b/start.sh
- index 75e734a00..10781c86c 100755
- --- a/start.sh
- +++ b/start.sh
- @@ -1,3 +1,3 @@
- #!/bin/sh
- -./Xsdl :1111 -screen 640x480x24 -mouse mouse -keybd keyboard
- +./Xsdl :0 -screen 640x480x24 -mouse mouse -keybd keyboard -nolock
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement