1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
8 SDESC[std]= Cross-platform multimedia development API
9 HOMEPAGE= http://www.libsdl.org/
13 SITES[main]= http://www.libsdl.org/release/
15 DISTFILE[1]= SDL-1.2.15.tar.gz:main
24 OPTIONS_AVAILABLE= AALIB OSS SNDIO PULSEAUDIO OPENGL X11
25 OPTIONS_STANDARD= AALIB OSS SNDIO PULSEAUDIO OPENGL X11
26 OPTGROUP_UNLIMITED= AUDIO
27 OPTDESCR[AUDIO]= Audio Support
28 OPTGROUP[AUDIO]= AALIB OSS SNDIO PULSEAUDIO
30 OPT_ON[all]= AALIB OPENGL X11
31 OPT_ON[dragonfly]= OSS
33 BUILD_DEPENDS= nasm:primary:std
35 USES= cpe gmake libtool pkgconfig iconv fbsd10fix
39 LICENSE= LGPL21+:primary
40 LICENSE_TERMS= primary:{{WRKDIR}}/TERMS
41 LICENSE_FILE= LGPL21+:{{WRKSRC}}/COPYING
42 LICENSE_AWK= TERMS:"SDL_config"
43 LICENSE_SOURCE= TERMS:{{WRKSRC}}/src/SDL.c
46 CPE_PRODUCT= simple_directmedia_layer
48 FPC_EQUIVALENT= devel/sdl12
51 CONFIGURE_ARGS= --disable-alsa
54 --disable-video-directfb
56 CONFIGURE_ENV= ac_cv_header_libusbhid_h=no
58 [OPENGL].BUILDRUN_DEPENDS_ON= libglvnd:primary:std
59 [OPENGL].BUILD_DEPENDS_ON= libglvnd:dev:std
60 [OPENGL].CONFIGURE_ENABLE_BOTH= video-opengl
62 [SNDIO].BUILDRUN_DEPENDS_ON= sndio:primary:std
63 [SNDIO].BUILD_DEPENDS_ON= sndio:dev:std
64 [SNDIO].CONFIGURE_ENABLE_BOTH= sndio
66 [AALIB].BUILDRUN_DEPENDS_ON= aalib:primary:std
67 [AALIB].BUILD_DEPENDS_ON= aalib:dev:std
68 [AALIB].CONFIGURE_ENABLE_BOTH= video-aalib
70 [PULSEAUDIO].BROKEN_ON= not yet implemented
72 [OSS].CONFIGURE_ENABLE_BOTH= oss
74 [X11].CONFIGURE_ENABLE_BOTH= video-x11
75 [X11].XORG_COMPONENTS_ON= x11
81 ${REINPLACE_CMD} -e '/EXTRA_LDFLAGS/s/-liconv/${ICONV_LIB}/' \
85 @${MKDIR} ${WRKSRC}/src/audio/sndio
86 ${CP} ${FILESDIR}/SDL_sndioaudio.* ${WRKSRC}/src/audio/sndio
89 @${MKDIR} ${STAGEDIR}${STD_DOCDIR} ${STAGEDIR}${STD_EXAMPLESDIR}
90 .for doc in BUGS CREDITS README README-SDL.txt WhatsNew docs.html
91 ${INSTALL_DATA} ${WRKSRC}/${doc} ${STAGEDIR}${STD_DOCDIR}/
93 (cd ${WRKSRC} && ${COPYTREE_SHARE} docs \
94 ${STAGEDIR}${STD_DOCDIR}/ "! -regex .*/man3.*")
95 .for exam in test/*.c test/*.bmp test/*.dat test/*.xbm test/*.wav
96 ${INSTALL_DATA} ${WRKSRC}/${exam} ${STAGEDIR}${STD_EXAMPLESDIR}/
98 ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libSDL-1.2.so.0
100 [FILE:385:descriptions/desc.primary]
101 The SDL library (series 1) is designed to make it easy to write games that
102 run on UNIX, Win32 and BeOS using the various native high-performance media
103 interfaces, (for video, audio, etc) and presenting a single source-code
104 level API to your application. This is a fairly low level API, but using
105 this, completely portable applications can be written with a great deal of
110 d6d316a793e5e348155f0dd93b979798933fb98aa1edebcc108829d6474aad00 3920622 SDL-1.2.15.tar.gz
113 [FILE:59:manifests/plist.primary]
120 [FILE:3283:manifests/plist.man]
147 SDL_CondWaitTimeout.3
153 SDL_CreateRGBSurface.3
154 SDL_CreateRGBSurfaceFrom.3
155 SDL_CreateSemaphore.3
157 SDL_CreateYUVOverlay.3
161 SDL_DestroySemaphore.3
163 SDL_DisplayFormatAlpha.3
164 SDL_DisplayYUVOverlay.3
165 SDL_EnableKeyRepeat.3
176 SDL_GL_GetAttribute.3
177 SDL_GL_GetProcAddress.3
179 SDL_GL_SetAttribute.3
196 SDL_GetRelativeMouseState.3
200 SDL_GetVideoSurface.3
208 SDL_JoystickEventState.3
209 SDL_JoystickGetAxis.3
210 SDL_JoystickGetBall.3
211 SDL_JoystickGetButton.3
215 SDL_JoystickNumAxes.3
216 SDL_JoystickNumBalls.3
217 SDL_JoystickNumButtons.3
218 SDL_JoystickNumHats.3
233 SDL_MouseButtonEvent.3
234 SDL_MouseMotionEvent.3
276 SDL_UnlockYUVOverlay.3
280 SDL_VideoDriverName.3
285 SDL_WM_IconifyWindow.3
288 SDL_WM_ToggleFullScreen.3
298 [FILE:531:manifests/plist.dev]
340 [FILE:541:patches/patch-Makefile.in]
341 --- Makefile.in.orig 2012-01-19 06:30:05 UTC
343 @@ -49,7 +49,7 @@ LT_AGE = @LT_AGE@
344 LT_CURRENT = @LT_CURRENT@
345 LT_RELEASE = @LT_RELEASE@
346 LT_REVISION = @LT_REVISION@
347 -LT_LDFLAGS = -no-undefined -rpath $(DESTDIR)$(libdir) -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
348 +LT_LDFLAGS = -no-undefined -rpath $(libdir) -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
350 all: $(srcdir)/configure Makefile $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET)
354 [FILE:4283:patches/patch-configure]
355 --- configure.orig 2012-01-19 06:30:12 UTC
357 @@ -2039,12 +2039,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
359 ac_config_headers="$ac_config_headers include/SDL_config.h"
362 -cat >>confdefs.h <<\_ACEOF
363 -#define _GNU_SOURCE 1
368 for ac_dir in $srcdir/build-scripts; do
369 if test -f "$ac_dir/install-sh"; then
370 @@ -4209,7 +4203,7 @@ darwin* | rhapsody*)
371 lt_cv_deplibs_check_method=pass_all
374 -freebsd* | dragonfly*)
375 +freebsd* | dragonfly* | midnight*)
376 if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
379 @@ -8411,7 +8405,7 @@ if test -z "$aix_libpath"; then aix_libp
382 # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
383 - freebsd* | dragonfly*)
384 + freebsd* | dragonfly* | midnight*)
385 archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
386 hardcode_libdir_flag_spec='-R$libdir'
388 @@ -9290,7 +9284,7 @@ freebsd1*)
392 -freebsd* | dragonfly*)
393 +freebsd* | dragonfly* | midnight*)
394 # DragonFly does not have aout. When/if they implement a new
395 # versioning mechanism, adjust this.
396 if test -x /usr/bin/objformat; then
397 @@ -13308,7 +13302,7 @@ if test -z "$aix_libpath"; then aix_libp
398 archive_cmds_need_lc_CXX=no
401 - freebsd* | dragonfly*)
402 + freebsd* | dragonfly* | midnight*)
403 # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
406 @@ -14258,7 +14252,7 @@ echo $ECHO_N "checking for $compiler opt
410 - freebsd* | dragonfly*)
411 + freebsd* | dragonfly* | midnight*)
412 # FreeBSD uses GNU C++
414 hpux9* | hpux10* | hpux11*)
415 @@ -15062,7 +15056,7 @@ freebsd1*)
419 -freebsd* | dragonfly*)
420 +freebsd* | dragonfly* | midnight*)
421 # DragonFly does not have aout. When/if they implement a new
422 # versioning mechanism, adjust this.
423 if test -x /usr/bin/objformat; then
424 @@ -15826,7 +15820,7 @@ case "$host" in
425 BASE_LDFLAGS="-mno-cygwin"
428 - BASE_CFLAGS="-D_GNU_SOURCE=1"
433 @@ -20999,6 +20993,16 @@ _ACEOF
440 +if test "x${enable_sndio}" = "xyes"; then :
441 + SOURCES="$SOURCES $srcdir/src/audio/sndio/SDL_sndioaudio.c"
442 + EXTRA_CFLAGS="$EXTRA_CFLAGS -DSDL_AUDIO_DRIVER_SNDIO=1"
443 + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lsndio"
450 @@ -26934,7 +26938,7 @@ fi
451 # causes Carbon.p complaints?
452 # pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
454 - *-*-freebsd*|*-*-dragonfly*)
455 + *-*-freebsd*|*-*-dragonfly*|*-*-midnight*)
456 pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
457 pthread_lib="-pthread"
459 @@ -29518,7 +29522,7 @@ _ACEOF
463 - *-*-linux*|*-*-uclinux*|*-*-gnu*|*-*-k*bsd*-gnu|*-*-bsdi*|*-*-freebsd*|*-*-dragonfly*|*-*-netbsd*|*-*-openbsd*|*-*-sysv5*|*-*-solaris*|*-*-hpux*|*-*-irix*|*-*-aix*|*-*-osf*)
464 + *-*-linux*|*-*-uclinux*|*-*-gnu*|*-*-k*bsd*-gnu|*-*-bsdi*|*-*-freebsd*|*-*-dragonfly*|*-*-netbsd*|*-*-openbsd*|*-*-sysv5*|*-*-solaris*|*-*-hpux*|*-*-irix*|*-*-aix*|*-*-osf*|*-*-midnight*)
466 *-*-linux*) ARCH=linux ;;
467 *-*-uclinux*) ARCH=linux ;;
468 @@ -29529,6 +29533,7 @@ _ACEOF
469 *-*-bsdi*) ARCH=bsdi ;;
470 *-*-freebsd*) ARCH=freebsd ;;
471 *-*-dragonfly*) ARCH=freebsd ;;
472 + *-*-midnightbsd*) ARCH=freebsd ;;
473 *-*-netbsd*) ARCH=netbsd ;;
474 *-*-openbsd*) ARCH=openbsd ;;
475 *-*-sysv5*) ARCH=sysv5 ;;
476 @@ -29551,6 +29556,7 @@ _ACEOF
484 @@ -29628,7 +29634,7 @@ _ACEOF
485 SOURCES="$SOURCES $srcdir/src/cdrom/linux/*.c"
489 + *freebsd*|*midnight*)
490 cat >>confdefs.h <<\_ACEOF
491 #define SDL_CDROM_FREEBSD 1
495 [FILE:474:patches/patch-sdl-config.in]
497 # Temporary hack to provide iconv include directory is well
498 # (sdl explicitly includes iconv.h)
500 --- sdl-config.in.orig 2012-01-19 06:30:06 UTC
502 @@ -42,7 +42,7 @@ while test $# -gt 0; do
506 - echo -I@includedir@/SDL @SDL_CFLAGS@
507 + echo -I@includedir@/SDL -I@includedir@ @SDL_CFLAGS@
509 @ENABLE_SHARED_TRUE@ --libs)
510 @ENABLE_SHARED_TRUE@ echo -L@libdir@ @SDL_RLD_FLAGS@ @SDL_LIBS@
513 [FILE:276:patches/patch-sdl.pc.in]
514 --- sdl.pc.in.orig 2012-01-19 06:30:06 UTC
516 @@ -12,4 +12,4 @@ Requires:
518 Libs: -L${libdir} @SDL_RLD_FLAGS@ @SDL_LIBS@
519 Libs.private: @SDL_STATIC_LIBS@
520 -Cflags: -I${includedir}/SDL @SDL_CFLAGS@
521 +Cflags: -I${includedir}/SDL -I${includedir} @SDL_CFLAGS@
524 [FILE:478:patches/patch-src_audio_SDL__audio.c]
525 $OpenBSD: patch-src_audio_SDL_audio_c,v 1.17 2012/03/02 09:10:38 dcoppa Exp $
526 --- src/audio/SDL_audio.c.orig 2012-01-19 06:30:06 UTC
527 +++ src/audio/SDL_audio.c
530 /* Available audio drivers */
531 static AudioBootStrap *bootstrap[] = {
533 #if SDL_AUDIO_DRIVER_PULSE
536 #if SDL_AUDIO_DRIVER_ALSA
539 +#if SDL_AUDIO_DRIVER_SNDIO
542 #if SDL_AUDIO_DRIVER_BSD
543 &BSD_AUDIO_bootstrap,
547 [FILE:449:patches/patch-src_audio_SDL__sysaudio.h]
548 $OpenBSD: patch-src_audio_SDL_sysaudio_h,v 1.6 2012/03/02 09:10:38 dcoppa Exp $
549 --- src/audio/SDL_sysaudio.h.orig 2012-01-19 06:30:06 UTC
550 +++ src/audio/SDL_sysaudio.h
551 @@ -105,6 +105,9 @@ typedef struct AudioBootStrap {
552 #if SDL_AUDIO_DRIVER_BSD
553 extern AudioBootStrap BSD_AUDIO_bootstrap;
555 +#if SDL_AUDIO_DRIVER_SNDIO
556 +extern AudioBootStrap SNDIO_bootstrap;
558 #if SDL_AUDIO_DRIVER_PULSE
559 extern AudioBootStrap PULSE_bootstrap;
563 [FILE:469:patches/patch-src_cdrom_freebsd_SDL_syscdrom.c]
564 --- src/cdrom/freebsd/SDL_syscdrom.c.orig 2012-01-19 06:30:06 UTC
565 +++ src/cdrom/freebsd/SDL_syscdrom.c
566 @@ -188,7 +188,7 @@ int SDL_SYS_CDInit(void)
569 for ( j=checklist[i][1]; exists; ++j ) {
570 - SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%sc", &checklist[i][3]);
571 + SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%s", &checklist[i][3]);
572 insert = SDL_strchr(drive, '?');
573 if ( insert != NULL ) {
577 [FILE:7860:patches/patch-src_joystick_bsd_SDL_sysjoystick.c]
578 --- src/joystick/bsd/SDL_sysjoystick.c.orig 2012-01-19 06:30:06 UTC
579 +++ src/joystick/bsd/SDL_sysjoystick.c
581 #define MAX_JOYS (MAX_UHID_JOYS + MAX_JOY_JOYS)
584 -#if defined(__FREEBSD__) && (__FreeBSD_kernel_version > 800063)
585 +#if defined(__FREEBSD__) && (__FreeBSD_kernel_version > 900000)
586 + void *buf; /* Buffer */
587 +#elif defined(__FREEBSD__) && (__FreeBSD_kernel_version > 800063)
588 struct usb_gen_descriptor *buf; /* Buffer */
590 struct usb_ctl_report *buf; /* Buffer */
591 @@ -148,8 +150,10 @@ static char *joydevnames[MAX_JOYS];
592 static int report_alloc(struct report *, struct report_desc *, int);
593 static void report_free(struct report *);
595 -#if defined(USBHID_UCR_DATA) || defined(__FreeBSD_kernel__)
596 +#if defined(USBHID_UCR_DATA) || (defined(__FreeBSD_kernel__) && __FreeBSD_kernel_version <= 800063)
597 #define REP_BUF_DATA(rep) ((rep)->buf->ucr_data)
598 +#elif (defined(__FREEBSD__) && (__FreeBSD_kernel_version > 900000))
599 +#define REP_BUF_DATA(rep) ((rep)->buf)
600 #elif (defined(__FREEBSD__) && (__FreeBSD_kernel_version > 800063))
601 #define REP_BUF_DATA(rep) ((rep)->buf->ugd_data)
603 @@ -411,47 +415,47 @@ SDL_SYS_JoystickUpdate(SDL_Joystick *joy
604 struct joystick gameport;
606 if (joy->hwdata->type == BSDJOY_JOY) {
607 - if (read(joy->hwdata->fd, &gameport, sizeof gameport) != sizeof gameport)
609 - if (abs(joy->hwdata->x - gameport.x) > 8) {
610 - joy->hwdata->x = gameport.x;
611 - if (joy->hwdata->x < joy->hwdata->xmin) {
612 - joy->hwdata->xmin = joy->hwdata->x;
614 - if (joy->hwdata->x > joy->hwdata->xmax) {
615 - joy->hwdata->xmax = joy->hwdata->x;
617 - if (joy->hwdata->xmin == joy->hwdata->xmax) {
618 - joy->hwdata->xmin--;
619 - joy->hwdata->xmax++;
621 - v = (Sint32)joy->hwdata->x;
622 - v -= (joy->hwdata->xmax + joy->hwdata->xmin + 1)/2;
623 - v *= 32768/((joy->hwdata->xmax - joy->hwdata->xmin + 1)/2);
624 - SDL_PrivateJoystickAxis(joy, 0, v);
626 - if (abs(joy->hwdata->y - gameport.y) > 8) {
627 - joy->hwdata->y = gameport.y;
628 - if (joy->hwdata->y < joy->hwdata->ymin) {
629 - joy->hwdata->ymin = joy->hwdata->y;
630 + while (read(joy->hwdata->fd, &gameport, sizeof gameport) == sizeof gameport) {
631 + if (abs(joy->hwdata->x - gameport.x) > 8) {
632 + joy->hwdata->x = gameport.x;
633 + if (joy->hwdata->x < joy->hwdata->xmin) {
634 + joy->hwdata->xmin = joy->hwdata->x;
636 + if (joy->hwdata->x > joy->hwdata->xmax) {
637 + joy->hwdata->xmax = joy->hwdata->x;
639 + if (joy->hwdata->xmin == joy->hwdata->xmax) {
640 + joy->hwdata->xmin--;
641 + joy->hwdata->xmax++;
643 + v = (Sint32)joy->hwdata->x;
644 + v -= (joy->hwdata->xmax + joy->hwdata->xmin + 1)/2;
645 + v *= 32768/((joy->hwdata->xmax - joy->hwdata->xmin + 1)/2);
646 + SDL_PrivateJoystickAxis(joy, 0, v);
648 + if (abs(joy->hwdata->y - gameport.y) > 8) {
649 + joy->hwdata->y = gameport.y;
650 + if (joy->hwdata->y < joy->hwdata->ymin) {
651 + joy->hwdata->ymin = joy->hwdata->y;
653 + if (joy->hwdata->y > joy->hwdata->ymax) {
654 + joy->hwdata->ymax = joy->hwdata->y;
656 + if (joy->hwdata->ymin == joy->hwdata->ymax) {
657 + joy->hwdata->ymin--;
658 + joy->hwdata->ymax++;
660 + v = (Sint32)joy->hwdata->y;
661 + v -= (joy->hwdata->ymax + joy->hwdata->ymin + 1)/2;
662 + v *= 32768/((joy->hwdata->ymax - joy->hwdata->ymin + 1)/2);
663 + SDL_PrivateJoystickAxis(joy, 1, v);
665 - if (joy->hwdata->y > joy->hwdata->ymax) {
666 - joy->hwdata->ymax = joy->hwdata->y;
667 + if (gameport.b1 != joy->buttons[0]) {
668 + SDL_PrivateJoystickButton(joy, 0, gameport.b1);
670 - if (joy->hwdata->ymin == joy->hwdata->ymax) {
671 - joy->hwdata->ymin--;
672 - joy->hwdata->ymax++;
673 + if (gameport.b2 != joy->buttons[1]) {
674 + SDL_PrivateJoystickButton(joy, 1, gameport.b2);
676 - v = (Sint32)joy->hwdata->y;
677 - v -= (joy->hwdata->ymax + joy->hwdata->ymin + 1)/2;
678 - v *= 32768/((joy->hwdata->ymax - joy->hwdata->ymin + 1)/2);
679 - SDL_PrivateJoystickAxis(joy, 1, v);
681 - if (gameport.b1 != joy->buttons[0]) {
682 - SDL_PrivateJoystickButton(joy, 0, gameport.b1);
684 - if (gameport.b2 != joy->buttons[1]) {
685 - SDL_PrivateJoystickButton(joy, 1, gameport.b2);
689 @@ -459,65 +463,61 @@ SDL_SYS_JoystickUpdate(SDL_Joystick *joy
691 rep = &joy->hwdata->inreport;
693 - if (read(joy->hwdata->fd, REP_BUF_DATA(rep), rep->size) != rep->size) {
696 + while (read(joy->hwdata->fd, REP_BUF_DATA(rep), rep->size) == rep->size) {
697 #if defined(USBHID_NEW) || (defined(__FREEBSD__) && __FreeBSD_kernel_version >= 500111) || defined(__FreeBSD_kernel__)
698 - hdata = hid_start_parse(joy->hwdata->repdesc, 1 << hid_input, rep->rid);
699 + hdata = hid_start_parse(joy->hwdata->repdesc, 1 << hid_input, rep->rid);
701 - hdata = hid_start_parse(joy->hwdata->repdesc, 1 << hid_input);
702 + hdata = hid_start_parse(joy->hwdata->repdesc, 1 << hid_input);
704 - if (hdata == NULL) {
705 - fprintf(stderr, "%s: Cannot start HID parser\n",
706 - joy->hwdata->path);
709 + if (hdata == NULL) {
710 + /*fprintf(stderr, "%s: Cannot start HID parser\n", joy->hwdata->path);*/
714 - for (nbutton = 0; hid_get_item(hdata, &hitem) > 0;) {
715 - switch (hitem.kind) {
717 - switch (HID_PAGE(hitem.usage)) {
718 - case HUP_GENERIC_DESKTOP: {
719 - unsigned usage = HID_USAGE(hitem.usage);
720 - int joyaxe = usage_to_joyaxe(usage);
722 - naxe = joy->hwdata->axis_map[joyaxe];
724 - v = (Sint32)hid_get_data(REP_BUF_DATA(rep),
726 - v -= (hitem.logical_maximum + hitem.logical_minimum + 1)/2;
727 - v *= 32768/((hitem.logical_maximum - hitem.logical_minimum + 1)/2);
728 - if (v != joy->axes[naxe]) {
729 - SDL_PrivateJoystickAxis(joy, naxe, v);
730 + for (nbutton = 0; hid_get_item(hdata, &hitem) > 0;) {
731 + switch (hitem.kind) {
733 + switch (HID_PAGE(hitem.usage)) {
734 + case HUP_GENERIC_DESKTOP: {
735 + unsigned usage = HID_USAGE(hitem.usage);
736 + int joyaxe = usage_to_joyaxe(usage);
738 + naxe = joy->hwdata->axis_map[joyaxe];
740 + v = (Sint32)hid_get_data(REP_BUF_DATA(rep),
742 + v -= (hitem.logical_maximum + hitem.logical_minimum + 1)/2;
743 + v *= 32768/((hitem.logical_maximum - hitem.logical_minimum + 1)/2);
744 + if (v != joy->axes[naxe]) {
745 + SDL_PrivateJoystickAxis(joy, naxe, v);
747 + } else if (usage == HUG_HAT_SWITCH) {
748 + v = (Sint32)hid_get_data(REP_BUF_DATA(rep),
750 + SDL_PrivateJoystickHat(joy, 0,
751 + hatval_to_sdl(v)-hitem.logical_minimum);
755 - } else if (usage == HUG_HAT_SWITCH) {
756 - v = (Sint32)hid_get_data(REP_BUF_DATA(rep),
758 - SDL_PrivateJoystickHat(joy, 0,
759 - hatval_to_sdl(v)-hitem.logical_minimum);
764 - v = (Sint32)hid_get_data(REP_BUF_DATA(rep),
766 - if (joy->buttons[nbutton] != v) {
767 - SDL_PrivateJoystickButton(joy,
770 + v = (Sint32)hid_get_data(REP_BUF_DATA(rep),
772 + if (joy->buttons[nbutton] != v) {
773 + SDL_PrivateJoystickButton(joy,
791 + hid_end_parse(hdata);
793 - hid_end_parse(hdata);
798 /* Function to close a joystick after use */
799 @@ -582,8 +582,12 @@ report_alloc(struct report *r, struct re
803 +#if defined(__FREEBSD__) && (__FreeBSD_kernel_version > 900000)
804 + r->buf = SDL_malloc(r->size);
806 r->buf = SDL_malloc(sizeof(*r->buf) - sizeof(REP_BUF_DATA(r)) +
809 if (r->buf == NULL) {
814 [FILE:498:patches/patch-src_video_x11_SDL_x11sym.h]
815 --- src/video/x11/SDL_x11sym.h.orig 2012-01-19 06:30:06 UTC
816 +++ src/video/x11/SDL_x11sym.h
817 @@ -165,7 +165,7 @@ SDL_X11_SYM(Bool,XShmQueryExtension,(Dis
820 SDL_X11_MODULE(IO_32BIT)
821 -SDL_X11_SYM(int,_XData32,(Display *dpy,register long *data,unsigned len),(dpy,data,len),return)
822 +SDL_X11_SYM(int,_XData32,(Display *dpy,register _Xconst long *data,unsigned len),(dpy,data,len),return)
823 SDL_X11_SYM(void,_XRead32,(Display *dpy,register long *data,long len),(dpy,data,len),)
828 [FILE:5310:files/SDL_sndioaudio.c]
830 * Copyright (c) 2008 Jacob Meuser <jakemsr@sdf.lonestar.org>
832 * Permission to use, copy, modify, and distribute this software for any
833 * purpose with or without fee is hereby granted, provided that the above
834 * copyright notice and this permission notice appear in all copies.
836 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
837 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
838 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
839 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
840 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
841 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
842 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
845 #include "SDL_config.h"
847 /* Allow access to a raw mixing buffer */
854 #include "SDL_timer.h"
855 #include "SDL_audio.h"
856 #include "../SDL_audiomem.h"
857 #include "../SDL_audio_c.h"
858 #include "../SDL_audiodev_c.h"
859 #include "SDL_sndioaudio.h"
861 /* The tag name used by sndio audio */
862 #define SNDIO_DRIVER_NAME "sndio"
864 /* Audio driver functions */
865 static int SNDIO_OpenAudio(_THIS, SDL_AudioSpec *spec);
866 static void SNDIO_WaitAudio(_THIS);
867 static void SNDIO_PlayAudio(_THIS);
868 static Uint8 *SNDIO_GetAudioBuf(_THIS);
869 static void SNDIO_CloseAudio(_THIS);
871 /* Audio driver bootstrap functions */
873 static int Audio_Available(void)
875 struct sio_hdl *this_hdl;
878 if ( (this_hdl = sio_open(SIO_DEVANY, SIO_PLAY, 0)) != NULL ) {
886 static void Audio_DeleteDevice(SDL_AudioDevice *device)
888 SDL_free(device->hidden);
892 static SDL_AudioDevice *Audio_CreateDevice(int devindex)
894 SDL_AudioDevice *this;
896 /* Initialize all variables that we clean on shutdown */
897 this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
899 SDL_memset(this, 0, (sizeof *this));
900 this->hidden = (struct SDL_PrivateAudioData *)
901 SDL_malloc((sizeof *this->hidden));
903 if ( (this == NULL) || (this->hidden == NULL) ) {
910 SDL_memset(this->hidden, 0, (sizeof *this->hidden));
912 /* Set the function pointers */
913 this->OpenAudio = SNDIO_OpenAudio;
914 this->WaitAudio = SNDIO_WaitAudio;
915 this->PlayAudio = SNDIO_PlayAudio;
916 this->GetAudioBuf = SNDIO_GetAudioBuf;
917 this->CloseAudio = SNDIO_CloseAudio;
919 this->free = Audio_DeleteDevice;
926 AudioBootStrap SNDIO_bootstrap = {
927 SNDIO_DRIVER_NAME, "sndio",
928 Audio_Available, Audio_CreateDevice
933 /* This function waits until it is possible to write a full sound buffer */
934 static void SNDIO_WaitAudio(_THIS)
936 /* nothing, we're using the blocking api */
939 static void SNDIO_PlayAudio(_THIS)
943 /* Write the audio data */
944 written = sio_write(hdl, mixbuf, mixlen);
946 /* If we couldn't write, assume fatal error for now */
947 if ( written == 0 ) {
951 fprintf(stderr, "Wrote %d bytes of audio data\n", written);
955 static Uint8 *SNDIO_GetAudioBuf(_THIS)
960 static void SNDIO_CloseAudio(_THIS)
962 if ( mixbuf != NULL ) {
963 SDL_FreeAudioMem(mixbuf);
972 static int SNDIO_OpenAudio(_THIS, SDL_AudioSpec *spec)
978 if ((hdl = sio_open(NULL, SIO_PLAY, 0)) == NULL) {
979 SDL_SetError("sio_open() failed");
985 switch (spec->format) {
1015 SDL_SetError("SNDIO unknown format");
1019 par.rate = spec->freq;
1020 par.pchan = spec->channels;
1021 par.round = spec->samples;
1022 par.appbufsz = par.round * 2;
1024 if (sio_setpar(hdl, &par) == 0) {
1025 SDL_SetError("sio_setpar() failed");
1029 if (sio_getpar(hdl, &par) == 0) {
1030 SDL_SetError("sio_getpar() failed");
1034 if (par.bits == 16) {
1035 if (par.sig && par.le) {
1036 spec->format = AUDIO_S16LSB;
1037 } else if (par.sig && !par.le) {
1038 spec->format = AUDIO_S16MSB;
1039 } else if (!par.sig && par.le) {
1040 spec->format = AUDIO_U16LSB;
1042 spec->format = AUDIO_U16MSB;
1043 } else if (par.bits == 8) {
1044 spec->format = par.sig ? AUDIO_S8 : AUDIO_U8;
1046 SDL_SetError("SNDIO couldn't configure a suitable format");
1050 spec->freq = par.rate;
1051 spec->channels = par.pchan;
1052 spec->samples = par.round;
1054 SDL_CalculateAudioSpec(spec);
1056 /* Allocate mixing buffer */
1057 mixlen = spec->size;
1058 mixbuf = (Uint8 *)SDL_AllocAudioMem(mixlen);
1059 if ( mixbuf == NULL ) {
1062 SDL_memset(mixbuf, spec->silence, spec->size);
1064 if ( sio_start(hdl) == 0 ) {
1065 SDL_SetError("sio_start() failed");
1069 /* We're ready to rock and roll. :-) */
1074 [FILE:1512:files/SDL_sndioaudio.h]
1076 * Copyright (c) 2008 Jacob Meuser <jakemsr@sdf.lonestar.org>
1078 * Permission to use, copy, modify, and distribute this software for any
1079 * purpose with or without fee is hereby granted, provided that the above
1080 * copyright notice and this permission notice appear in all copies.
1082 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
1083 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
1084 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
1085 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
1086 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
1087 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
1088 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1091 #include "SDL_config.h"
1093 #ifndef _SDL_sndioaudio_h
1094 #define _SDL_sndioaudio_h
1098 #include "../SDL_sysaudio.h"
1100 /* Hidden "this" pointer for the video functions */
1101 #define _THIS SDL_AudioDevice *this
1103 struct SDL_PrivateAudioData {
1104 /* The stream descriptor for the audio device */
1105 struct sio_hdl *hdl;
1107 /* The parent process id, to detect when application quits */
1110 /* Raw mixing buffer */
1116 /* Old variable names */
1117 #define stream (this->hidden->stream)
1118 #define parent (this->hidden->parent)
1119 #define mixbuf (this->hidden->mixbuf)
1120 #define mixlen (this->hidden->mixlen)
1121 #define hdl (this->hidden->hdl)
1123 #endif /* _SDL_sndioaudio_h */