test/loopwave.c
changeset 1463 0394f8ebc42d
parent 1151 be9c9c8f6d53
child 1659 14717b52abc0
     1.1 --- a/test/loopwave.c	Thu Mar 02 13:26:24 2006 +0000
     1.2 +++ b/test/loopwave.c	Fri Mar 03 04:43:42 2006 +0000
     1.3 @@ -4,10 +4,14 @@
     1.4  /* loopwaves.c is much more robust in handling WAVE files -- 
     1.5  	This is only for simple WAVEs
     1.6  */
     1.7 +#include "SDL_config.h"
     1.8  
     1.9  #include <stdio.h>
    1.10  #include <stdlib.h>
    1.11 +
    1.12 +#if HAVE_SIGNAL_H
    1.13  #include <signal.h>
    1.14 +#endif
    1.15  
    1.16  #include "SDL.h"
    1.17  #include "SDL_audio.h"
    1.18 @@ -65,12 +69,9 @@
    1.19  		fprintf(stderr, "Couldn't initialize SDL: %s\n",SDL_GetError());
    1.20  		return(1);
    1.21  	}
    1.22 -
    1.23  	if ( argv[1] == NULL ) {
    1.24 -		fprintf(stderr, "Usage: %s <wavefile>\n", argv[0]);
    1.25 -		quit(1);
    1.26 +		argv[1] = "sample.wav";
    1.27  	}
    1.28 -
    1.29  	/* Load the wave file into memory */
    1.30  	if ( SDL_LoadWAV(argv[1],
    1.31  			&wave.spec, &wave.sound, &wave.soundlen) == NULL ) {
    1.32 @@ -78,8 +79,9 @@
    1.33  						argv[1], SDL_GetError());
    1.34  		quit(1);
    1.35  	}
    1.36 +
    1.37  	wave.spec.callback = fillerup;
    1.38 -
    1.39 +#if HAVE_SIGNAL_H
    1.40  	/* Set the signals */
    1.41  #ifdef SIGHUP
    1.42  	signal(SIGHUP, poked);
    1.43 @@ -89,6 +91,7 @@
    1.44  	signal(SIGQUIT, poked);
    1.45  #endif
    1.46  	signal(SIGTERM, poked);
    1.47 +#endif /* HAVE_SIGNAL_H */
    1.48  
    1.49  	/* Initialize fillerup() variables */
    1.50  	if ( SDL_OpenAudio(&wave.spec, NULL) < 0 ) {