Mercurial > octave
comparison libinterp/octave-value/ov-fcn-handle.cc @ 21211:2cf8bc5c7017
use "#if defined (HAVE_FOO)" instead of "#if HAVE_FOO" for feature tests
* configure.ac (HAVE_HDF5_INT2FLOAT_CONVERSIONS): AC_DEFINE here.
* ls-hdf5.cc (HAVE_HDF5_INT2FLOAT_CONVERSION): Delete definition.
* ls-hdf5.cc, ls-hdf5.h, ccolamd.cc, dmperm.cc, ov-base-int.cc,
ov-bool-mat.cc, ov-bool-sparse.cc, ov-bool.cc, ov-cell.cc,
ov-class.cc, ov-complex.cc, ov-cx-mat.cc, ov-cx-sparse.cc,
ov-fcn-handle.cc, ov-fcn-inline.cc, ov-float.cc, ov-flt-complex.cc,
ov-flt-cx-mat.cc, ov-flt-re-mat.cc, ov-java.cc, ov-range.cc,
ov-re-mat.cc, ov-re-sparse.cc, ov-scalar.cc, ov-str-mat.cc,
ov-struct.cc, pt-eval.cc:
Use #if defined (HAVE_FOO) instead of #if HAVE_FOO.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sat, 06 Feb 2016 08:48:47 -0500 |
parents | fcac5dbbf9ed |
children | 40de9f8f23a6 |
comparison
equal
deleted
inserted
replaced
21210:4f7d3989c462 | 21211:2cf8bc5c7017 |
---|---|
686 #if defined (HAVE_HDF5) | 686 #if defined (HAVE_HDF5) |
687 | 687 |
688 bool retval = true; | 688 bool retval = true; |
689 | 689 |
690 hid_t group_hid = -1; | 690 hid_t group_hid = -1; |
691 #if HAVE_HDF5_18 | 691 #if defined (HAVE_HDF5_18) |
692 group_hid = H5Gcreate (loc_id, name, octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); | 692 group_hid = H5Gcreate (loc_id, name, octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); |
693 #else | 693 #else |
694 group_hid = H5Gcreate (loc_id, name, 0); | 694 group_hid = H5Gcreate (loc_id, name, 0); |
695 #endif | 695 #endif |
696 if (group_hid < 0) | 696 if (group_hid < 0) |
716 { | 716 { |
717 H5Tclose (type_hid); | 717 H5Tclose (type_hid); |
718 H5Gclose (group_hid); | 718 H5Gclose (group_hid); |
719 return false; | 719 return false; |
720 } | 720 } |
721 #if HAVE_HDF5_18 | 721 #if defined (HAVE_HDF5_18) |
722 data_hid = H5Dcreate (group_hid, "nm", type_hid, space_hid, | 722 data_hid = H5Dcreate (group_hid, "nm", type_hid, space_hid, |
723 octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); | 723 octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); |
724 #else | 724 #else |
725 data_hid = H5Dcreate (group_hid, "nm", type_hid, space_hid, octave_H5P_DEFAULT); | 725 data_hid = H5Dcreate (group_hid, "nm", type_hid, space_hid, octave_H5P_DEFAULT); |
726 #endif | 726 #endif |
747 H5Sclose (space_hid); | 747 H5Sclose (space_hid); |
748 H5Gclose (group_hid); | 748 H5Gclose (group_hid); |
749 return false; | 749 return false; |
750 } | 750 } |
751 | 751 |
752 #if HAVE_HDF5_18 | 752 #if defined (HAVE_HDF5_18) |
753 data_hid = H5Dcreate (group_hid, "fcn", type_hid, space_hid, | 753 data_hid = H5Dcreate (group_hid, "fcn", type_hid, space_hid, |
754 octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); | 754 octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); |
755 #else | 755 #else |
756 data_hid = H5Dcreate (group_hid, "fcn", type_hid, space_hid, | 756 data_hid = H5Dcreate (group_hid, "fcn", type_hid, space_hid, |
757 octave_H5P_DEFAULT); | 757 octave_H5P_DEFAULT); |
778 { | 778 { |
779 hid_t as_id = H5Screate (H5S_SCALAR); | 779 hid_t as_id = H5Screate (H5S_SCALAR); |
780 | 780 |
781 if (as_id >= 0) | 781 if (as_id >= 0) |
782 { | 782 { |
783 #if HAVE_HDF5_18 | 783 #if defined (HAVE_HDF5_18) |
784 hid_t a_id = H5Acreate (group_hid, "SYMBOL_TABLE", | 784 hid_t a_id = H5Acreate (group_hid, "SYMBOL_TABLE", |
785 H5T_NATIVE_IDX, as_id, | 785 H5T_NATIVE_IDX, as_id, |
786 octave_H5P_DEFAULT, octave_H5P_DEFAULT); | 786 octave_H5P_DEFAULT, octave_H5P_DEFAULT); |
787 | 787 |
788 #else | 788 #else |
801 | 801 |
802 H5Sclose (as_id); | 802 H5Sclose (as_id); |
803 } | 803 } |
804 else | 804 else |
805 retval = false; | 805 retval = false; |
806 #if HAVE_HDF5_18 | 806 #if defined (HAVE_HDF5_18) |
807 data_hid = H5Gcreate (group_hid, "symbol table", | 807 data_hid = H5Gcreate (group_hid, "symbol table", |
808 octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); | 808 octave_H5P_DEFAULT, octave_H5P_DEFAULT, octave_H5P_DEFAULT); |
809 #else | 809 #else |
810 data_hid = H5Gcreate (group_hid, "symbol table", 0); | 810 data_hid = H5Gcreate (group_hid, "symbol table", 0); |
811 #endif | 811 #endif |
846 } | 846 } |
847 | 847 |
848 H5Tclose (type_hid); | 848 H5Tclose (type_hid); |
849 type_hid = H5Tcopy (H5T_C_S1); | 849 type_hid = H5Tcopy (H5T_C_S1); |
850 H5Tset_size (type_hid, octaveroot.length () + 1); | 850 H5Tset_size (type_hid, octaveroot.length () + 1); |
851 #if HAVE_HDF5_18 | 851 #if defined (HAVE_HDF5_18) |
852 hid_t a_id = H5Acreate (group_hid, "OCTAVEROOT", | 852 hid_t a_id = H5Acreate (group_hid, "OCTAVEROOT", |
853 type_hid, space_hid, octave_H5P_DEFAULT, octave_H5P_DEFAULT); | 853 type_hid, space_hid, octave_H5P_DEFAULT, octave_H5P_DEFAULT); |
854 #else | 854 #else |
855 hid_t a_id = H5Acreate (group_hid, "OCTAVEROOT", | 855 hid_t a_id = H5Acreate (group_hid, "OCTAVEROOT", |
856 type_hid, space_hid, octave_H5P_DEFAULT); | 856 type_hid, space_hid, octave_H5P_DEFAULT); |
883 | 883 |
884 H5Tclose (type_hid); | 884 H5Tclose (type_hid); |
885 type_hid = H5Tcopy (H5T_C_S1); | 885 type_hid = H5Tcopy (H5T_C_S1); |
886 H5Tset_size (type_hid, fpath.length () + 1); | 886 H5Tset_size (type_hid, fpath.length () + 1); |
887 | 887 |
888 #if HAVE_HDF5_18 | 888 #if defined (HAVE_HDF5_18) |
889 a_id = H5Acreate (group_hid, "FILE", type_hid, space_hid, | 889 a_id = H5Acreate (group_hid, "FILE", type_hid, space_hid, |
890 octave_H5P_DEFAULT, octave_H5P_DEFAULT); | 890 octave_H5P_DEFAULT, octave_H5P_DEFAULT); |
891 #else | 891 #else |
892 a_id = H5Acreate (group_hid, "FILE", type_hid, space_hid, octave_H5P_DEFAULT); | 892 a_id = H5Acreate (group_hid, "FILE", type_hid, space_hid, octave_H5P_DEFAULT); |
893 #endif | 893 #endif |
923 | 923 |
924 hid_t group_hid, data_hid, space_hid, type_hid, type_class_hid, st_id; | 924 hid_t group_hid, data_hid, space_hid, type_hid, type_class_hid, st_id; |
925 hsize_t rank; | 925 hsize_t rank; |
926 int slen; | 926 int slen; |
927 | 927 |
928 #if HAVE_HDF5_18 | 928 #if defined (HAVE_HDF5_18) |
929 group_hid = H5Gopen (loc_id, name, octave_H5P_DEFAULT); | 929 group_hid = H5Gopen (loc_id, name, octave_H5P_DEFAULT); |
930 #else | 930 #else |
931 group_hid = H5Gopen (loc_id, name); | 931 group_hid = H5Gopen (loc_id, name); |
932 #endif | 932 #endif |
933 if (group_hid < 0) | 933 if (group_hid < 0) |
934 return false; | 934 return false; |
935 | 935 |
936 #if HAVE_HDF5_18 | 936 #if defined (HAVE_HDF5_18) |
937 data_hid = H5Dopen (group_hid, "nm", octave_H5P_DEFAULT); | 937 data_hid = H5Dopen (group_hid, "nm", octave_H5P_DEFAULT); |
938 #else | 938 #else |
939 data_hid = H5Dopen (group_hid, "nm"); | 939 data_hid = H5Dopen (group_hid, "nm"); |
940 #endif | 940 #endif |
941 | 941 |
997 H5Dclose (data_hid); | 997 H5Dclose (data_hid); |
998 nm = nm_tmp; | 998 nm = nm_tmp; |
999 | 999 |
1000 if (nm == anonymous) | 1000 if (nm == anonymous) |
1001 { | 1001 { |
1002 #if HAVE_HDF5_18 | 1002 #if defined (HAVE_HDF5_18) |
1003 data_hid = H5Dopen (group_hid, "fcn", octave_H5P_DEFAULT); | 1003 data_hid = H5Dopen (group_hid, "fcn", octave_H5P_DEFAULT); |
1004 #else | 1004 #else |
1005 data_hid = H5Dopen (group_hid, "fcn"); | 1005 data_hid = H5Dopen (group_hid, "fcn"); |
1006 #endif | 1006 #endif |
1007 | 1007 |
1076 H5E_auto_t err_func; | 1076 H5E_auto_t err_func; |
1077 void *err_func_data; | 1077 void *err_func_data; |
1078 | 1078 |
1079 // turn off error reporting temporarily, but save the error | 1079 // turn off error reporting temporarily, but save the error |
1080 // reporting function: | 1080 // reporting function: |
1081 #if HAVE_HDF5_18 | 1081 #if defined (HAVE_HDF5_18) |
1082 H5Eget_auto (octave_H5E_DEFAULT, &err_func, &err_func_data); | 1082 H5Eget_auto (octave_H5E_DEFAULT, &err_func, &err_func_data); |
1083 H5Eset_auto (octave_H5E_DEFAULT, 0, 0); | 1083 H5Eset_auto (octave_H5E_DEFAULT, 0, 0); |
1084 #else | 1084 #else |
1085 H5Eget_auto (&err_func, &err_func_data); | 1085 H5Eget_auto (&err_func, &err_func_data); |
1086 H5Eset_auto (0, 0); | 1086 H5Eset_auto (0, 0); |
1095 | 1095 |
1096 H5Aclose (attr_id); | 1096 H5Aclose (attr_id); |
1097 } | 1097 } |
1098 | 1098 |
1099 // restore error reporting: | 1099 // restore error reporting: |
1100 #if HAVE_HDF5_18 | 1100 #if defined (HAVE_HDF5_18) |
1101 H5Eset_auto (octave_H5E_DEFAULT, err_func, err_func_data); | 1101 H5Eset_auto (octave_H5E_DEFAULT, err_func, err_func_data); |
1102 #else | 1102 #else |
1103 H5Eset_auto (err_func, err_func_data); | 1103 H5Eset_auto (err_func, err_func_data); |
1104 #endif | 1104 #endif |
1105 | 1105 |
1117 frame.add_fcn (octave_call_stack::pop); | 1117 frame.add_fcn (octave_call_stack::pop); |
1118 | 1118 |
1119 if (len > 0 && success) | 1119 if (len > 0 && success) |
1120 { | 1120 { |
1121 hsize_t num_obj = 0; | 1121 hsize_t num_obj = 0; |
1122 #if HAVE_HDF5_18 | 1122 #if defined (HAVE_HDF5_18) |
1123 data_hid = H5Gopen (group_hid, "symbol table", octave_H5P_DEFAULT); | 1123 data_hid = H5Gopen (group_hid, "symbol table", octave_H5P_DEFAULT); |
1124 #else | 1124 #else |
1125 data_hid = H5Gopen (group_hid, "symbol table"); | 1125 data_hid = H5Gopen (group_hid, "symbol table"); |
1126 #endif | 1126 #endif |
1127 H5Gget_num_objs (data_hid, &num_obj); | 1127 H5Gget_num_objs (data_hid, &num_obj); |
1182 H5E_auto_t err_func; | 1182 H5E_auto_t err_func; |
1183 void *err_func_data; | 1183 void *err_func_data; |
1184 | 1184 |
1185 // turn off error reporting temporarily, but save the error | 1185 // turn off error reporting temporarily, but save the error |
1186 // reporting function: | 1186 // reporting function: |
1187 #if HAVE_HDF5_18 | 1187 #if defined (HAVE_HDF5_18) |
1188 H5Eget_auto (octave_H5E_DEFAULT, &err_func, &err_func_data); | 1188 H5Eget_auto (octave_H5E_DEFAULT, &err_func, &err_func_data); |
1189 H5Eset_auto (octave_H5E_DEFAULT, 0, 0); | 1189 H5Eset_auto (octave_H5E_DEFAULT, 0, 0); |
1190 #else | 1190 #else |
1191 H5Eget_auto (&err_func, &err_func_data); | 1191 H5Eget_auto (&err_func, &err_func_data); |
1192 H5Eset_auto (0, 0); | 1192 H5Eset_auto (0, 0); |
1248 H5Aclose (attr_id); | 1248 H5Aclose (attr_id); |
1249 } | 1249 } |
1250 } | 1250 } |
1251 | 1251 |
1252 // restore error reporting: | 1252 // restore error reporting: |
1253 #if HAVE_HDF5_18 | 1253 #if defined (HAVE_HDF5_18) |
1254 H5Eset_auto (octave_H5E_DEFAULT, err_func, err_func_data); | 1254 H5Eset_auto (octave_H5E_DEFAULT, err_func, err_func_data); |
1255 #else | 1255 #else |
1256 H5Eset_auto (err_func, err_func_data); | 1256 H5Eset_auto (err_func, err_func_data); |
1257 #endif | 1257 #endif |
1258 | 1258 |