[SDL 2.0] SDL_Init(SDL_INIT_VIDEO) crashes in FreeBSD (Patch)

Hi all

In SDL 2.0 SDL_Init(SDL_INIT_VIDEO) develops segmentation fault in FreeBSD.

That’s due to SDL_INPUT_LINUXEV section in X11_InitTouch() in src/video/x11/SDL_x11touch.cis Linux specific and get executed under FreeBSD.

Following patch solves this but X11_InitTouch() may need to be compatible with FreeBSD:

diff -Naur SDL.ORIG/src/video/x11/SDL_x11touch.c SDL/src/video/x11/SDL_x11touch.c
— SDL.ORIG/src/video/x11/SDL_x11touch.c??? 2012-06-28 16:07:57.000000000 +0530
+++ SDL/src/video/x11/SDL_x11touch.c??? 2012-06-29 22:36:28.000000000 +0530
@@ -43,6 +43,8 @@
??? X11_InitXinput2Multitouch(_this);
??? return;
??? }+
+#if defined(LINUX)
?#ifdef SDL_INPUT_LINUXEV
??? FILE *fd;
??? fd = fopen("/proc/bus/input/devices",“r”);
@@ -118,6 +120,7 @@
??? }
??? fclose(fd);
?#endif
+#endif
?}

?void

Btw, there is no such as /proc/bus/input/devices in FreeBSD.

Best regards
Unga

Unga :

Hi all

In SDL 2.0 SDL_Init(SDL_INIT_VIDEO) develops segmentation fault in FreeBSD.

That’s due to SDL_INPUT_LINUXEV section in X11_InitTouch() in
src/video/x11/SDL_x11touch.cis Linux specific and get executed under
FreeBSD.

The issue, you ran into, is already filed under
http://bugzilla.libsdl.org/show_bug.cgi?id=1530.
I’d rather not deactivate the Xinput code with a LINUX #ifdef, since
this will cause it to be
forgotten on FreeBSD.

Cheers
Marcus

Cc:

Unga <@Unga>:

Hi all

In SDL 2.0 SDL_Init(SDL_INIT_VIDEO) develops segmentation fault in FreeBSD.

That’s due to SDL_INPUT_LINUXEV section in X11_InitTouch() in
src/video/x11/SDL_x11touch.cis Linux specific and get executed under FreeBSD.

The issue, you ran into, is already filed under
http://bugzilla.libsdl.org/show_bug.cgi?id=1530.
I’d rather not deactivate the Xinput code with a LINUX #ifdef, since this
will cause it to be
forgotten on FreeBSD.

Cheers
Marcus

Good to note its been fixed on July 02nd. So is the touch facility available under FreeBSD?

Unga> From: “mva at sysfault.org

To: Unga <@Unga>; sdl at lists.libsdl.org
Sent: Wednesday, July 4, 2012 11:09 AM
Subject: Re: [SDL] [SDL 2.0] SDL_Init(SDL_INIT_VIDEO) crashes in FreeBSD (Patch)

Unga :

Cc:
FreeBSD (Patch)

Unga :

Hi all

In SDL 2.0 SDL_Init(SDL_INIT_VIDEO) develops segmentation fault
in FreeBSD.

That’s due to SDL_INPUT_LINUXEV section in X11_InitTouch() in
src/video/x11/SDL_x11touch.cis Linux specific and get executed
under FreeBSD.

The issue, you ran into, is already filed under
http://bugzilla.libsdl.org/show_bug.cgi?id=1530.
I’d rather not deactivate the Xinput code with a LINUX #ifdef, since this
will cause it to be
forgotten on FreeBSD.

Cheers
Marcus

Good to note its been fixed on July 02nd. So is the touch facility
available under FreeBSD?

No - first of all, the current X11 touch input support in SDL is
solely focusing
on Linux (usage of /proc/, Linux EV system, etc.). Secondly, the
current X11 status
in FreeBSD does not fully support the Xinput2 interfaces - Xorg 7.7 is
currently
tested for FreeBSD (set WITH_NEW_XORG in /etc/make.conf).

Cheers
Marcus>> From: “@Marcus_von_Appen” <@Marcus_von_Appen>

To: Unga ; sdl at lists.libsdl.org
Sent: Wednesday, July 4, 2012 11:09 AM
Subject: Re: [SDL] [SDL 2.0] SDL_Init(SDL_INIT_VIDEO) crashes in