comparison src/joystick/bsd/SDL_sysjoystick.c @ 3366:8cd9ed45c020

Adapted from Debian patch: 215_kfreebsd_gnu.diff
author Sam Lantinga <slouken@libsdl.org>
date Sat, 10 Oct 2009 09:36:12 +0000
parents 99210400e8b9
children 7a7a61a1484d
comparison
equal deleted inserted replaced
3365:9cd5b35c0184 3366:8cd9ed45c020
307 if (rep->size <= 0) { 307 if (rep->size <= 0) {
308 SDL_SetError("%s: Input report descriptor has invalid length", 308 SDL_SetError("%s: Input report descriptor has invalid length",
309 hw->path); 309 hw->path);
310 goto usberr; 310 goto usberr;
311 } 311 }
312 #if defined(USBHID_NEW) || (defined(__FREEBSD__) && __FreeBSD_version >= 500111) 312 #if defined(USBHID_NEW) || (defined(__FREEBSD__) && __FreeBSD_kernel_version >= 500111)
313 hdata = hid_start_parse(hw->repdesc, 1 << hid_input, rep->rid); 313 hdata = hid_start_parse(hw->repdesc, 1 << hid_input, rep->rid);
314 #else 314 #else
315 hdata = hid_start_parse(hw->repdesc, 1 << hid_input); 315 hdata = hid_start_parse(hw->repdesc, 1 << hid_input);
316 #endif 316 #endif
317 if (hdata == NULL) { 317 if (hdata == NULL) {
449 rep = &joy->hwdata->inreport; 449 rep = &joy->hwdata->inreport;
450 450
451 if (read(joy->hwdata->fd, REP_BUF_DATA(rep), rep->size) != rep->size) { 451 if (read(joy->hwdata->fd, REP_BUF_DATA(rep), rep->size) != rep->size) {
452 return; 452 return;
453 } 453 }
454 #if defined(USBHID_NEW) || (defined(__FREEBSD__) && __FreeBSD_version >= 500111) 454 #if defined(USBHID_NEW) || (defined(__FREEBSD__) && __FreeBSD_kernel_version >= 500111)
455 hdata = hid_start_parse(joy->hwdata->repdesc, 1 << hid_input, rep->rid); 455 hdata = hid_start_parse(joy->hwdata->repdesc, 1 << hid_input, rep->rid);
456 #else 456 #else
457 hdata = hid_start_parse(joy->hwdata->repdesc, 1 << hid_input); 457 hdata = hid_start_parse(joy->hwdata->repdesc, 1 << hid_input);
458 #endif 458 #endif
459 if (hdata == NULL) { 459 if (hdata == NULL) {
545 int len; 545 int len;
546 546
547 #ifdef __DragonFly__ 547 #ifdef __DragonFly__
548 len = hid_report_size(rd, r->rid, repinfo[repind].kind); 548 len = hid_report_size(rd, r->rid, repinfo[repind].kind);
549 #elif __FREEBSD__ 549 #elif __FREEBSD__
550 # if (__FreeBSD_version >= 460000) 550 # if (__FreeBSD_kernel_version >= 460000) || defined(__FreeBSD_kernel__)
551 # if (__FreeBSD_version <= 500111) 551 # if (__FreeBSD_kernel_version <= 500111)
552 len = hid_report_size(rd, r->rid, repinfo[repind].kind); 552 len = hid_report_size(rd, r->rid, repinfo[repind].kind);
553 # else 553 # else
554 len = hid_report_size(rd, repinfo[repind].kind, r->rid); 554 len = hid_report_size(rd, repinfo[repind].kind, r->rid);
555 # endif 555 # endif
556 # else 556 # else