Skip to content

Commit

Permalink
..
Browse files Browse the repository at this point in the history
  • Loading branch information
dweindl committed Sep 25, 2024
1 parent 5f2ce73 commit 6b1d73b
Showing 1 changed file with 72 additions and 0 deletions.
72 changes: 72 additions & 0 deletions ThirdParty/sundials/include/sundials/sundials_types_deprecated.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/* -----------------------------------------------------------------
* SUNDIALS Copyright Start
* Copyright (c) 2002-2024, Lawrence Livermore National Security
* and Southern Methodist University.
* All rights reserved.
*
* See the top-level LICENSE and NOTICE files for details.
*
* SPDX-License-Identifier: BSD-3-Clause
* SUNDIALS Copyright End
* -----------------------------------------------------------------
* This header file exports realtype and booleantype and a few macros
* related to realtype for backwards compatibility. It is preferable
* to only use the types defined in sundials_types.h .
* -----------------------------------------------------------------*/

#ifndef _SUNDIALS_TYPES_DEPRECATED_H
#define _SUNDIALS_TYPES_DEPRECATED_H

#include <float.h>
#include <stddef.h>
#include <stdint.h>
#include <sundials/sundials_config.h>
#include <sundials/sundials_types.h>

#ifdef __cplusplus /* wrapper to enable C++ usage */
extern "C" {
#endif

/*
*------------------------------------------------------------------
* Type realtype
* Macro RCONST
* Constants SMALL_REAL, BIG_REAL, and UNIT_ROUNDOFF
*------------------------------------------------------------------
*/

#if defined(SUNDIALS_SINGLE_PRECISION)

typedef float realtype;
#define RCONST(x) x##F
#define BIG_REAL FLT_MAX
#define SMALL_REAL FLT_MIN
#define UNIT_ROUNDOFF FLT_EPSILON

#elif defined(SUNDIALS_DOUBLE_PRECISION)

typedef double realtype;
#define RCONST(x) x
#define BIG_REAL DBL_MAX
#define SMALL_REAL DBL_MIN
#define UNIT_ROUNDOFF DBL_EPSILON

#elif defined(SUNDIALS_EXTENDED_PRECISION)

typedef long double realtype;
#define RCONST(x) x##L
#define BIG_REAL LDBL_MAX
#define SMALL_REAL LDBL_MIN
#define UNIT_ROUNDOFF LDBL_EPSILON

#endif

#ifndef booleantype
#define booleantype int
#endif

#ifdef __cplusplus
}
#endif

#endif /* _SUNDIALS_TYPES_DEPRECATED_H */

0 comments on commit 6b1d73b

Please sign in to comment.