[brlcad-commits] SF.net SVN: brlcad:[49038] brlcad/trunk/src/libbu/test_sscanf.c
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: <n_...@us...> - 2012-01-24 16:49:44
|
Revision: 49038 http://brlcad.svn.sourceforge.net/brlcad/?rev=49038&view=rev Author: n_reed Date: 2012-01-24 16:49:34 +0000 (Tue, 24 Jan 2012) Log Message: ----------- Still need vsscanf for test routine. For now, require it to run test. Modified Paths: -------------- brlcad/trunk/src/libbu/test_sscanf.c Modified: brlcad/trunk/src/libbu/test_sscanf.c =================================================================== --- brlcad/trunk/src/libbu/test_sscanf.c 2012-01-24 16:23:44 UTC (rev 49037) +++ brlcad/trunk/src/libbu/test_sscanf.c 2012-01-24 16:49:34 UTC (rev 49038) @@ -111,6 +111,7 @@ * val_test * equality test for two val_type vals named a and b, like (a == b) */ +#ifdef HAVE_VSSCANF #define TEST_SSCANF(conv_spec, val_type, val_test) \ /* returns true if a and b are equal */ \ static int \ @@ -181,8 +182,12 @@ bu_values = NULL; \ } \ } +#else +#define TEST_SSCANF(conv_spec, val_type, val_test) /* nop */ +#endif /* string test routine */ +#ifdef HAVE_VSSCANF static void test_sscanf_s(const char *src, const char *fmt, ...) { @@ -257,6 +262,9 @@ values = bu_values = NULL; } } +#else +#define test_sscanf_s sscanf +#endif /* integer test routines */ TEST_SSCANF(d, int, (a == b)) @@ -287,6 +295,11 @@ char c_vals[3]; char s_vals[3][STR_SIZE]; +#ifndef HAVE_VSSCANF + printf("%s requires a system vsscanf for proper execution.\n", argv[0]); + return 0; +#endif + if (argc > 1) { printf("Warning: %s takes no arguments.\n", argv[0]); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |