GNU Octave  6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
oct-hdf5-types.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 2016-2021 The Octave Project Developers
4 //
5 // See the file COPYRIGHT.md in the top-level directory of this
6 // distribution or <https://octave.org/copyright/>.
7 //
8 // This file is part of Octave.
9 //
10 // Octave is free software: you can redistribute it and/or modify it
11 // under the terms of the GNU General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // Octave is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with Octave; see the file COPYING. If not, see
22 // <https://www.gnu.org/licenses/>.
23 //
24 ////////////////////////////////////////////////////////////////////////
25 
26 #if defined (HAVE_CONFIG_H)
27 # include "config.h"
28 #endif
29 
30 #include "error.h"
31 #include "errwarn.h"
32 #include "oct-hdf5.h"
33 
34 bool
35 check_hdf5_types (bool warn)
36 {
37  static bool checked = false;
38  static bool ok = false;
39 
40  if (! checked)
41  {
42 #if defined (HAVE_HDF5)
43 
44  ok = sizeof (octave_hdf5_id) >= sizeof (hid_t);
45 
46  if (warn && ! ok)
48  ("Octave:internal",
49  "the size of octave_hdf5_id is smaller than the size of HDF5 hid_t");
50 
51  ok = sizeof (octave_hdf5_err) >= sizeof (herr_t);
52 
53  if (warn && ! ok)
55  ("Octave:internal",
56  "the size of octave_hdf5_err is smaller than the size of HDF5 herr_t");
57 #else
58 
59  octave_unused_parameter (warn);
60 
61  warn_disabled_feature ("check_hdf5_id_type", "HDF5");
62 
63 #endif
64 
65  checked = true;
66  }
67 
68  return ok;
69 }
void warning_with_id(const char *id, const char *fmt,...)
Definition: error.cc:1065
void warn_disabled_feature(const std::string &fcn, const std::string &feature, const std::string &pkg)
Definition: errwarn.cc:318
bool check_hdf5_types(bool warn)
int octave_hdf5_err
int64_t octave_hdf5_id