Mercurial > octave
comparison scripts/testfun/__have_feature__.m @ 21253:a66a737913b5
allow __have_feature__ to check for ENABLE_ options
* __have_feature__.m: Handle ENABLE_ options.
* mex_demo.c, oct_demo.cc: Update note about octave_config_info.
* toplev.cc (Foctave_config_info): For ENABLE_ options, store logical
values instead of true/false or yes/no strings in struct.
* computer.m: Change use of octave_config_info ("ENABLE_64").
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 12 Feb 2016 16:28:51 -0500 |
parents | a55b8ece1ecd |
children | 1da428cbf401 |
comparison
equal
deleted
inserted
replaced
21252:b2ec3a699ad7 | 21253:a66a737913b5 |
---|---|
20 ## @deftypefn {} {} __have_feature__ (feature) | 20 ## @deftypefn {} {} __have_feature__ (feature) |
21 ## Undocumented internal function. | 21 ## Undocumented internal function. |
22 ## @end deftypefn | 22 ## @end deftypefn |
23 | 23 |
24 function retval = __have_feature__ (feature) | 24 function retval = __have_feature__ (feature) |
25 features = octave_config_info ("build_features"); | 25 if (strncmp (feature, "ENABLE_", 7)) |
26 features = octave_config_info (); | |
27 else | |
28 features = octave_config_info ("build_features"); | |
29 endif | |
26 if (iscellstr (feature)) | 30 if (iscellstr (feature)) |
27 retval = (all (isfield (features, feature)) | 31 retval = (all (isfield (features, feature)) |
28 && cellfun (@(x) features.(x), feature)); | 32 && cellfun (@(x) features.(x), feature)); |
29 elseif (ischar (feature)) | 33 elseif (ischar (feature)) |
30 retval = isfield (features, feature) && features.(feature); | 34 retval = isfield (features, feature) && features.(feature); |