| 1 |
/* |
| 2 |
* Copyright (c) 2015-2026, The matio contributors |
| 3 |
* Copyright (c) 2010-2014, Christopher C. Hulbert |
| 4 |
* All rights reserved. |
| 5 |
* |
| 6 |
* Redistribution and use in source and binary forms, with or without |
| 7 |
* modification, are permitted provided that the following conditions are met: |
| 8 |
* |
| 9 |
* 1. Redistributions of source code must retain the above copyright notice, this |
| 10 |
* list of conditions and the following disclaimer. |
| 11 |
* |
| 12 |
* 2. Redistributions in binary form must reproduce the above copyright notice, |
| 13 |
* this list of conditions and the following disclaimer in the documentation |
| 14 |
* and/or other materials provided with the distribution. |
| 15 |
* |
| 16 |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 17 |
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 18 |
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 19 |
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
| 20 |
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 21 |
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
| 22 |
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| 23 |
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| 24 |
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 25 |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 26 |
*/ |
| 27 |
|
| 28 |
#ifndef MATIO_PUBCONF_H |
| 29 |
#define MATIO_PUBCONF_H 1 |
| 30 |
|
| 31 |
/* Matio major version number */ |
| 32 |
#undef MATIO_MAJOR_VERSION |
| 33 |
|
| 34 |
/* Matio minor version number */ |
| 35 |
#undef MATIO_MINOR_VERSION |
| 36 |
|
| 37 |
/* Matio release level number */ |
| 38 |
#undef MATIO_RELEASE_LEVEL |
| 39 |
|
| 40 |
/* Matio version number */ |
| 41 |
#undef MATIO_VERSION |
| 42 |
|
| 43 |
/* Matio version string */ |
| 44 |
#undef MATIO_VERSION_STR |
| 45 |
|
| 46 |
/* Default file format */ |
| 47 |
#undef MAT_FT_DEFAULT |
| 48 |
|
| 49 |
/* Define to 1 if you have the <stdint.h> header file. */ |
| 50 |
#undef MATIO_HAVE_STDINT_H |
| 51 |
|
| 52 |
/* Define to 1 if you have the <inttypes.h> header file. */ |
| 53 |
#undef MATIO_HAVE_INTTYPES_H |
| 54 |
|
| 55 |
/* int16 type */ |
| 56 |
#undef _mat_int16_t |
| 57 |
|
| 58 |
/* int32 type */ |
| 59 |
#undef _mat_int32_t |
| 60 |
|
| 61 |
/* int64 type */ |
| 62 |
#undef _mat_int64_t |
| 63 |
|
| 64 |
/* int8 type */ |
| 65 |
#undef _mat_int8_t |
| 66 |
|
| 67 |
/* uint16 type */ |
| 68 |
#undef _mat_uint16_t |
| 69 |
|
| 70 |
/* uint32 type */ |
| 71 |
#undef _mat_uint32_t |
| 72 |
|
| 73 |
/* uint64 type */ |
| 74 |
#undef _mat_uint64_t |
| 75 |
|
| 76 |
/* uint8 type */ |
| 77 |
#undef _mat_uint8_t |
| 78 |
|
| 79 |
#if MATIO_HAVE_INTTYPES_H |
| 80 |
#include <inttypes.h> |
| 81 |
#endif |
| 82 |
|
| 83 |
#if MATIO_HAVE_STDINT_H |
| 84 |
#include <stdint.h> |
| 85 |
#endif |
| 86 |
|
| 87 |
#ifdef _mat_int64_t |
| 88 |
typedef _mat_int64_t mat_int64_t; |
| 89 |
#endif |
| 90 |
#ifdef _mat_uint64_t |
| 91 |
typedef _mat_uint64_t mat_uint64_t; |
| 92 |
#endif |
| 93 |
#ifdef _mat_int32_t |
| 94 |
typedef _mat_int32_t mat_int32_t; |
| 95 |
#endif |
| 96 |
#ifdef _mat_uint32_t |
| 97 |
typedef _mat_uint32_t mat_uint32_t; |
| 98 |
#endif |
| 99 |
#ifdef _mat_int16_t |
| 100 |
typedef _mat_int16_t mat_int16_t; |
| 101 |
#endif |
| 102 |
#ifdef _mat_uint16_t |
| 103 |
typedef _mat_uint16_t mat_uint16_t; |
| 104 |
#endif |
| 105 |
#ifdef _mat_int8_t |
| 106 |
typedef _mat_int8_t mat_int8_t; |
| 107 |
#endif |
| 108 |
#ifdef _mat_uint8_t |
| 109 |
typedef _mat_uint8_t mat_uint8_t; |
| 110 |
#endif |
| 111 |
|
| 112 |
/* |
| 113 |
The following macros handle noreturn attributes according to the |
| 114 |
C11/C++11 standard with fallback to GNU, Clang or MSVC extensions if using |
| 115 |
an older compiler. |
| 116 |
*/ |
| 117 |
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L |
| 118 |
#define MATIO_NORETURN _Noreturn |
| 119 |
#define MATIO_NORETURNATTR |
| 120 |
#elif __cplusplus >= 201103L |
| 121 |
#if (defined(__GNUC__) && __GNUC__ >= 5) || \ |
| 122 |
(defined(__GNUC__) && defined(__GNUC_MINOR__) && __GNUC__ == 4 && __GNUC_MINOR__ >= 8) |
| 123 |
#define MATIO_NORETURN [[noreturn]] |
| 124 |
#define MATIO_NORETURNATTR |
| 125 |
#elif (defined(__GNUC__) && __GNUC__ >= 3) || \ |
| 126 |
(defined(__GNUC__) && defined(__GNUC_MINOR__) && __GNUC__ == 2 && __GNUC_MINOR__ >= 8) |
| 127 |
#define MATIO_NORETURN |
| 128 |
#define MATIO_NORETURNATTR __attribute__((noreturn)) |
| 129 |
#elif defined(__GNUC__) |
| 130 |
#define MATIO_NORETURN |
| 131 |
#define MATIO_NORETURNATTR |
| 132 |
#else |
| 133 |
#define MATIO_NORETURN [[noreturn]] |
| 134 |
#define MATIO_NORETURNATTR |
| 135 |
#endif |
| 136 |
#elif defined(__clang__) |
| 137 |
#if __has_attribute(noreturn) |
| 138 |
#define MATIO_NORETURN |
| 139 |
#define MATIO_NORETURNATTR __attribute__((noreturn)) |
| 140 |
#else |
| 141 |
#define MATIO_NORETURN |
| 142 |
#define MATIO_NORETURNATTR |
| 143 |
#endif |
| 144 |
#elif (defined(__GNUC__) && __GNUC__ >= 3) || \ |
| 145 |
(defined(__GNUC__) && defined(__GNUC_MINOR__) && __GNUC__ == 2 && __GNUC_MINOR__ >= 8) || \ |
| 146 |
(defined(__SUNPRO_C) && __SUNPRO_C >= 0x5110) |
| 147 |
#define MATIO_NORETURN |
| 148 |
#define MATIO_NORETURNATTR __attribute__((noreturn)) |
| 149 |
#elif (defined(_MSC_VER) && _MSC_VER >= 1200) || defined(__BORLANDC__) |
| 150 |
#define MATIO_NORETURN __declspec(noreturn) |
| 151 |
#define MATIO_NORETURNATTR |
| 152 |
#else |
| 153 |
#define MATIO_NORETURN |
| 154 |
#define MATIO_NORETURNATTR |
| 155 |
#endif |
| 156 |
|
| 157 |
/* |
| 158 |
The following macros handle format attributes for type-checks against a |
| 159 |
format string. |
| 160 |
*/ |
| 161 |
|
| 162 |
#if defined(__GNUC__) && __GNUC__ >= 3 |
| 163 |
#define MATIO_FORMATATTR_PRINTF1 __attribute__((format(printf, 1, 2))) |
| 164 |
#define MATIO_FORMATATTR_PRINTF2 __attribute__((format(printf, 2, 3))) |
| 165 |
#define MATIO_FORMATATTR_VPRINTF __attribute__((format(printf, 1, 0))) |
| 166 |
#elif defined(__clang__) |
| 167 |
#if __has_attribute(format) |
| 168 |
#define MATIO_FORMATATTR_PRINTF1 __attribute__((format(printf, 1, 2))) |
| 169 |
#define MATIO_FORMATATTR_PRINTF2 __attribute__((format(printf, 2, 3))) |
| 170 |
#define MATIO_FORMATATTR_VPRINTF __attribute__((format(printf, 1, 0))) |
| 171 |
#else |
| 172 |
#define MATIO_FORMATATTR_PRINTF1 |
| 173 |
#define MATIO_FORMATATTR_PRINTF2 |
| 174 |
#define MATIO_FORMATATTR_VPRINTF |
| 175 |
#endif |
| 176 |
#else |
| 177 |
#define MATIO_FORMATATTR_PRINTF1 |
| 178 |
#define MATIO_FORMATATTR_PRINTF2 |
| 179 |
#define MATIO_FORMATATTR_VPRINTF |
| 180 |
#endif |
| 181 |
|
| 182 |
/* |
| 183 |
The following macro handles the deprecated attribute. |
| 184 |
*/ |
| 185 |
|
| 186 |
#if defined(__GNUC__) || defined(__clang__) |
| 187 |
#define MATIO_DEPRECATED __attribute__((deprecated)) |
| 188 |
#elif defined(_MSC_VER) |
| 189 |
#define MATIO_DEPRECATED __declspec(deprecated) |
| 190 |
#else |
| 191 |
#define MATIO_DEPRECATED |
| 192 |
#endif |
| 193 |
|
| 194 |
#endif /* MATIO_PUBCONF_H */ |