Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -2346,10 +2346,18 @@ AC_MSG_RESULT(yes) OBJCFLAGS="$old_OBJCFLAGS -Wno-gnu-imaginary-constant" ]) ]) ]) + +case "$host_os" in +linux*) + AS_IF([test x"$enable_files" != x"no"], [ + AC_SUBST(USE_SRCS_EVDEV, '${SRCS_EVDEV}') + ]) + ;; +esac AS_IF([test x"$cross_compiling" = x"yes"], [ AC_SUBST(BIN_PREFIX, "${host_alias}-") case "$host" in Index: extra.mk.in ================================================================== --- extra.mk.in +++ extra.mk.in @@ -95,10 +95,11 @@ TLS_CPPFLAGS = @TLS_CPPFLAGS@ TLS_LIBS = @TLS_LIBS@ UNICODE_M = @UNICODE_M@ USE_INCLUDES_ATOMIC = @USE_INCLUDES_ATOMIC@ USE_SRCS_APPLETALK = @USE_SRCS_APPLETALK@ +USE_SRCS_EVDEV = @USE_SRCS_EVDEV@ USE_SRCS_FILES = @USE_SRCS_FILES@ USE_SRCS_IPX = @USE_SRCS_IPX@ USE_SRCS_PLUGINS = @USE_SRCS_PLUGINS@ USE_SRCS_SCTP = @USE_SRCS_SCTP@ USE_SRCS_SOCKETS = @USE_SRCS_SOCKETS@ Index: src/hid/Makefile ================================================================== --- src/hid/Makefile +++ src/hid/Makefile @@ -12,11 +12,13 @@ SRCS = OHGameController.m \ OHGameControllerAxis.m \ OHGameControllerButton.m \ OHGameControllerDirectionalPad.m \ OHGameControllerElement.m \ - OHGameControllerProfile.m + OHGameControllerProfile.m \ + ${USE_SRCS_EVDEV} +SRCS_EVDEV = OHEvdevGameController.m INCLUDES := ${SRCS:.m=.h} \ ObjFWHID.h SRCS += OHGameControllerEmulatedAxis.m \ Index: src/hid/OHEvdevGameController.m ================================================================== --- src/hid/OHEvdevGameController.m +++ src/hid/OHEvdevGameController.m @@ -533,12 +533,14 @@ OHEvdevGameControllerAxis *axis; errno = 0; if (read(_fd, &event, sizeof(event)) < (int)sizeof(event)) { - if (errno == EWOULDBLOCK) + if (errno == EWOULDBLOCK) { + objc_autoreleasePoolPop(pool); return; + } @throw [OFReadFailedException exceptionWithObject: self requestedLength: sizeof(event) errNo: errno]; @@ -589,12 +591,10 @@ axis->_minValue, axis->_maxValue); break; } } - - objc_autoreleasePoolPop(pool); } - (OFComparisonResult)compare: (OHEvdevGameController *)otherController { unsigned long long selfIndex, otherIndex; Index: src/hid/OHGameController.m ================================================================== --- src/hid/OHGameController.m +++ src/hid/OHGameController.m @@ -81,9 +81,5 @@ else return [OFString stringWithFormat: @"<%@: %@>", self.class, self.name]; } @end - -#if defined(OF_LINUX) && defined(OF_HAVE_FILES) -# include "OHEvdevGameController.m" -#endif