comparison src/joystick/bsd/SDL_sysjoystick.c @ 4305:ecb22f65f0aa SDL-1.2

Adapted from 215_kfreebsd_gnu.diff
author Sam Lantinga <slouken@libsdl.org>
date Sat, 10 Oct 2009 09:38:02 +0000
parents a1b03ba2fcd0
children aa6aac8a5243
comparison
equal deleted inserted replaced
4304:1a0bd446d096 4305:ecb22f65f0aa
304 SDL_SetError("%s: Input report descriptor has invalid length", 304 SDL_SetError("%s: Input report descriptor has invalid length",
305 hw->path); 305 hw->path);
306 goto usberr; 306 goto usberr;
307 } 307 }
308 308
309 #if defined(USBHID_NEW) || (defined(__FREEBSD__) && __FreeBSD_version >= 500111) 309 #if defined(USBHID_NEW) || (defined(__FREEBSD__) && __FreeBSD_kernel_version >= 500111)
310 hdata = hid_start_parse(hw->repdesc, 1 << hid_input, rep->rid); 310 hdata = hid_start_parse(hw->repdesc, 1 << hid_input, rep->rid);
311 #else 311 #else
312 hdata = hid_start_parse(hw->repdesc, 1 << hid_input); 312 hdata = hid_start_parse(hw->repdesc, 1 << hid_input);
313 #endif 313 #endif
314 if (hdata == NULL) { 314 if (hdata == NULL) {
443 rep = &joy->hwdata->inreport; 443 rep = &joy->hwdata->inreport;
444 444
445 if (read(joy->hwdata->fd, REP_BUF_DATA(rep), rep->size) != rep->size) { 445 if (read(joy->hwdata->fd, REP_BUF_DATA(rep), rep->size) != rep->size) {
446 return; 446 return;
447 } 447 }
448 #if defined(USBHID_NEW) || (defined(__FREEBSD__) && __FreeBSD_version >= 500111) 448 #if defined(USBHID_NEW) || (defined(__FREEBSD__) && __FreeBSD_kernel_version >= 500111)
449 hdata = hid_start_parse(joy->hwdata->repdesc, 1 << hid_input, rep->rid); 449 hdata = hid_start_parse(joy->hwdata->repdesc, 1 << hid_input, rep->rid);
450 #else 450 #else
451 hdata = hid_start_parse(joy->hwdata->repdesc, 1 << hid_input); 451 hdata = hid_start_parse(joy->hwdata->repdesc, 1 << hid_input);
452 #endif 452 #endif
453 if (hdata == NULL) { 453 if (hdata == NULL) {
539 int len; 539 int len;
540 540
541 #ifdef __DragonFly__ 541 #ifdef __DragonFly__
542 len = hid_report_size(rd, r->rid, repinfo[repind].kind); 542 len = hid_report_size(rd, r->rid, repinfo[repind].kind);
543 #elif __FREEBSD__ 543 #elif __FREEBSD__
544 # if (__FreeBSD_version >= 460000) 544 # if (__FreeBSD_kernel_version >= 460000) || defined(__FreeBSD_kernel__)
545 # if (__FreeBSD_version <= 500111) 545 # if (__FreeBSD_kernel_version <= 500111)
546 len = hid_report_size(rd, r->rid, repinfo[repind].kind); 546 len = hid_report_size(rd, r->rid, repinfo[repind].kind);
547 # else 547 # else
548 len = hid_report_size(rd, repinfo[repind].kind, r->rid); 548 len = hid_report_size(rd, repinfo[repind].kind, r->rid);
549 # endif 549 # endif
550 # else 550 # else