Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6837
Modified Files: Tag: devel_0_39 s_main.c Log Message: if .pdrc or commandline has an option not supported in this build, tell the user something better than "unknown option".
Index: s_main.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_main.c,v retrieving revision 1.7.4.17.2.19 retrieving revision 1.7.4.17.2.20 diff -C2 -d -r1.7.4.17.2.19 -r1.7.4.17.2.20 *** s_main.c 23 Nov 2006 14:51:29 -0000 1.7.4.17.2.19 --- s_main.c 23 Nov 2006 15:03:31 -0000 1.7.4.17.2.20 *************** *** 644,647 **** --- 644,650 ---- int sys_parsercfile(char*filename);
+ #undef NOT_HERE + #define NOT_HERE(x) fprintf(stderr,"option "x" not compiled into this pd\n") + int sys_argparse(int argc, char **argv) { *************** *** 734,804 **** argc--; argv++; } - #ifdef USEAPI_OSS else if (!strcmp(*argv, "-oss")) { sys_set_audio_api(API_OSS); argc--; argv++; } else if (!strcmp(*argv, "-32bit")) { sys_set_audio_api(API_OSS); oss_set32bit(); argc--; argv++; } - #endif - #ifdef USEAPI_ALSA else if (!strcmp(*argv, "-alsa")) { sys_set_audio_api(API_ALSA); argc--; argv++; } else if (!strcmp(*argv, "-alsaadd")) { if (argc > 1) alsa_adddev(argv[1]); else goto usage; argc -= 2; argv +=2; } else if (!strcmp(*argv, "-alsamidi")) { sys_set_midi_api(API_ALSA); argc--; argv++; } - #endif - #ifdef USEAPI_JACK else if (!strcmp(*argv, "-jack")) { sys_set_audio_api(API_JACK); argc--; argv++; } ! #endif ! #ifdef USEAPI_PORTAUDIO ! else if (!strcmp(*argv, "-pa") || !strcmp(*argv, "-portaudio") ! #ifdef MSW ! || !strcmp(*argv, "-asio") ! #endif ) { sys_set_audio_api(API_PORTAUDIO); sys_mmio = 0; argc--; argv++; } - #endif - #ifdef USEAPI_ASIO else if (!strcmp(*argv, "-asio_native")) { sys_set_audio_api(API_ASIO); ! sys_mmio = 0; argc--; argv++; } - #endif - #ifdef USEAPI_MMIO else if (!strcmp(*argv, "-mmio")) { sys_set_audio_api(API_MMIO); sys_mmio = 1; argc--; argv++; } - #endif else if (!strcmp(*argv, "-nomidiin")) { --- 737,828 ---- argc--; argv++; } else if (!strcmp(*argv, "-oss")) { + #ifdef USEAPI_OSS sys_set_audio_api(API_OSS); + #else + NOT_HERE("-oss"); + #endif argc--; argv++; } else if (!strcmp(*argv, "-32bit")) { + #ifdef USEAPI_OSS sys_set_audio_api(API_OSS); + #else + NOT_HERE("-32bit"); + #endif oss_set32bit(); argc--; argv++; } else if (!strcmp(*argv, "-alsa")) { + #ifdef USEAPI_ALSA sys_set_audio_api(API_ALSA); + #else + NOT_HERE("-alsa"); + #endif argc--; argv++; } else if (!strcmp(*argv, "-alsaadd")) { + #ifdef USEAPI_ALSA if (argc > 1) alsa_adddev(argv[1]); else goto usage; + #else + NOT_HERE("-alsaadd"); + #endif argc -= 2; argv +=2; } else if (!strcmp(*argv, "-alsamidi")) { + #ifdef USEAPI_ALSA sys_set_midi_api(API_ALSA); + #else + NOT_HERE("-alsamidi"); + #endif argc--; argv++; } else if (!strcmp(*argv, "-jack")) { + #ifdef USEAPI_JACK sys_set_audio_api(API_JACK); + #else + NOT_HERE("-jack"); + #endif argc--; argv++; } ! else if (!strcmp(*argv, "-pa") || !strcmp(*argv, "-portaudio") || !strcmp(*argv, "-asio") ) { + #ifdef USEAPI_PORTAUDIO sys_set_audio_api(API_PORTAUDIO); + #else + NOT_HERE("-portaudio"); + #endif sys_mmio = 0; argc--; argv++; } else if (!strcmp(*argv, "-asio_native")) { + #ifdef USEAPI_ASIO sys_set_audio_api(API_ASIO); ! #else ! NOT_HERE("-asio_native"); ! #endif ! sys_mmio = 0; argc--; argv++; } else if (!strcmp(*argv, "-mmio")) { + #ifdef USEAPI_MMIO sys_set_audio_api(API_MMIO); + #else + NOT_HERE("-mmio"); + #endif sys_mmio = 1; argc--; argv++; } else if (!strcmp(*argv, "-nomidiin")) {